Fix Blogger ?m=1 Issue + Redirect Errors in Google Search Console

Learn how to remove ?m=1 from Blogger mobile URLs and fix the redirect issue in Search Console. Improve your website's presence in Google search.
Remove ?m=1 in Blogger

Nowadays, many Blogger users are facing a redirection error issue in the search console, which prevents the indexing of their pages in Google search. The main reason behind this problem is the extra parameter, which shows in the mobile URLs of a Blogger-based blog. From the beginning of Blogger, there was ?m=1 or ?m=0 in url's, but this redirection error problem came recently.

The Blogger adds ?m=1 automatically in mobile URLs to display the mobile version of that website, but now most of the themes are being released as fully responsive themes, so this extra parameter is no longer needed. Nowadays, this ?m=1 parameter is causing problems in indexing for some blogger websites in the name of redirect error, other canonical tags, etc.

Blogger doesn't have an inbuilt option to disable the ?m=1 parameter, but if you are using a custom domain and you connected your domain with Cloudflare in proximized mode, then you can easily remove ?m=1 it from your Blogger blog's mobile URL. In this article, we are going to show you how to remove ?m=1 the parameter from your Blogger URL and fix redirection errors or any errors caused by the ?m=1 parameter. So, without wasting much time, let's check.

Why Blogger Adds ?m=1 to Mobile URLs

Blogger adds?m=1 parameter in the URL when you visit the Blogger blog from a mobile device. This was created to load seperate version of the website on mobile, which looks good on mobile devices. In the early days, many Blogger templates were not responsive, so adding the ?m=1 parameter helped to display a good and simplified mobile version to users.

At this time, most of the Blogger templates are fully responsive and adapt automatically to different screen sizeswhich made this parameter unnecessary. However, Blogger still use this. As a result of this, it started creating multiple versions of the same page and also started having issues like duplicate content, redirect error and other indexing problems in the search console.

Requirements for this Fix

A custom domain name connected with your Blogger blog and Cloudflare in Proximized mode.

How to Remove ?m=1 from Blogger (Step-by-Step Guide)

Warning! Cloudflare have workers limit. If your website hits this limit, your website may become inaccessible.

    Create Worker in Cloudflare

  1. First of all, go to your Cloudflare Dashboard
  2. Click "Compute" from the sidebar
  3. Click the "Workers & Pages" option
  4. Click the "Create Application" button  on that page
  5. Click "Start with Hello World!"
  6. Set a name for your worker
  7. Click the "Deploy" button
  8. Click the "Edit code" button in that worker
  9. Replace the code inside it with the code given below
  10. /**
     * @typedef Env
     * @property {string} my_var
     */
    
    // device detection regexes
    const _a = /(?:phone|windows\s+phone|ipod|blackberry|(?:android|bb\d+|meego|silk|googlebot) .+? mobile|palm|windows\s+ce|opera\ mini|avantgo|mobilesafari|docomo|KAIOS)/i;
    const _b = /(?:ipad|playbook|(?:android|bb\d+|meego|silk)(?! .+? mobile))/i;
    
    const _c = (x) => {
      let y = "desktop";
      if (typeof x === "string") {
        if (_a.test(x)) y = "mobile";
        else if (_b.test(x)) y = "tablet";
      }
      return y;
    };
    
    const _worker = {
      async fetch(req, env, ctx) {
        // Avoid recursion: internal request marker
        if (req.headers.has("X-Worker-Internal")) {
          const h = new Headers(req.headers);
          h.delete("X-Worker-Internal");
          return fetch(new Request(req, { headers: h }));
        }
    
        try {
          const url = new URL(req.url);
          const t = _c(req.headers.get("User-Agent"));
    
          // Remove ?m=1 for non‑desktop devices
          if (t !== "desktop") url.searchParams.delete("m");
    
          // Cache key based on the cleaned URL
          const cacheKey = new Request(url.toString());
          const cache = caches.default;
    
          let resp = await cache.match(cacheKey);
          if (!resp) {
            const proxied = new Request(url, {
              method: req.method,
              body: req.body,
              headers: req.headers,
              redirect: "follow",
            });
            proxied.headers.set("X-Worker-Internal", "true");
    
            const originResp = await fetch(proxied, { signal: AbortSignal.timeout(5000) });
            resp = new Response(originResp.body, originResp);
            ctx.waitUntil(cache.put(cacheKey, resp.clone()));
          }
          return resp;
        } catch (err) {
          // Silent fallback: directly fetch the origin without altering the URL
          console.error("Worker error, using direct fallback:", err);
          const fallbackReq = new Request(req);
          fallbackReq.headers.set("X-Worker-Internal", "true");
          return fetch(fallbackReq);
        }
      },
    };
    
    export default _worker;
  11. Click the "Deploy" button
  12. Configure Worker Route for Your Custom Domain

  13. Go back to your Cloudflare dashboard
  14. Click "Domains" from the sidebar
  15. Click "Overview"
  16. Click on your domain where you need to remove the ?m=1 parameter
  17. Click the "Workers Route" option from the sidebar
  18. Click the  "Add route" button
  19. In the "Route" section, type your domain in the format given below
  20. www.coshix.in/*
  21. In the "Worker" section, choose the worker we just created
  22. Click the "Save" button
Done! Now check your blog from your mobile device, the ?m=1 parameter has been removed from your URL.

Validate fixes in Search Console

  1. Go to your Search Console dashboard
  2. Make sure you choosen right domain
  3. Click the "Pages" option from the sidebar
  4. Click on the error (e.g Redirect Error)
  5. Click the "Validate Fix" button

FAQs

Why ?m=1 in Blogger Mobile URLs?

I provided an answer to this question in this post. ?m=1 was added because in older times, there were less responsive Blogger templates so Blogger added ?m=1 to mobile URLs to apply a different version of the same website in mobile to show a simplified and good-looking page in mobile.

Why i getting a redirect error in Search Console in my Blogger website?

In Blogger, most of times redirect error was caused by improper handling of the ?m=1 parameter, multiple redirects or incorrect canonical URL.

Can we remove the ?m=1 parameter completely from the mobile URL?

Yes, we can remove it if you have been using a custom domain and Cloudflare. Currently, we haven't found any method to fix this issue in the blogspot subdomain blog.

Which method is best for removing ?m=1 from the Blogger blog URL?

Custom domain + Cloudflare Worker method is best for removing ?m=1 from the mobile URL.

Conclusion

Removing ?m=1 from your Blogger blog's mobile URLs is not a simple change, it improves your blog's presence in search results. By removing uneccessary parameter and keeping a clean URL improves SEO and improves the visibility of your blog. However, you also need to be aware of the limit of Cloudflare workers and make sure your blog doesn't hit that limit.

Once everything is configured very well, your blog becomes SEO friendly, easier to index and ready to be indexed in search engines. Even after making these changes, you need to keep monitoring your blog and keep your blog updated. Also, keeping an indexed single version of your website avoids confusion for both users and Google.

Using this worker with its proper caching and loop prevention helps you to keep your blog fast and avoid uneccessary redirect in your Blogger blog. Hope this tutorial helps you to remove ?m=1 and fix the redirect error in your Search Console. If you have any doubts related to this Cloudflare setup, then don't forget to drop a comment below. If you also like to add a login and signup system with amazing features in your Blogger website, then don't forget to check out the "How to Add Login and Signup in Blogger Using Firebase" tutorial.  Thanks for reading this post.

Post a Comment

Hey, keep comments chill ✌️
Don't spam please - Let's keep it clear and useful 💙

Join the conversation