If you’ve seen ?m=1
added to your Blogger site URLs when viewed on mobile, you’re not alone. This small-looking parameter can have big effects on your site's SEO, performance, and URL structure consistency.
But don’t worry, I have the solution. In this guide, I’ll show you three proven methods to remove ?m=1
permanently:
- One using JavaScript, which works without any extra tools
- Two advanced methods using Cloudflare, ideal for custom domains

Let’s fix it and make your blog faster and SEO-friendly today!
Why Remove ?m=1 from Blogger URLs?
?m=1
is a mobile URL parameter added automatically by Blogger to indicate a mobile version of the page. When users visit your blog on a phone, Blogger appends this to the end of URLs.
- Example:
Original URL: https://yourblog.blogspot.com Mobile URL: https://yourblog.blogspot.com/?m=1
- Why is it Bad?
- It can confuse search engines, causing indexing issues.
- It creates duplicate URLs, hurting your SEO.
- It slows down performance with unnecessary redirects.
Let's look at three ways you can implement this.
3 Proven Methods to Remove ?m=1 from Blogger
Below are three effective methods: one using JavaScript for simplicity and two using Cloudflare for advanced users with custom domains. Note that Cloudflare methods require a custom domain (not .blogspot.com
) and DNS managed by Cloudflare with proxy enabled. Be aware of Cloudflare’s free tier limitations: limited daily requests (100,000 for Workers) and potential downtime if exceeded.
Method 1: Remove ?m=1 Using JavaScript (Recommended for all)
This method uses JavaScript to hide ?m=1
in the browser’s address bar without affecting page content, ideal for users without Cloudflare or those seeking a quick fix.
- Log in to your Blogger Dashboard.
- Navigate to Theme > Edit HTML.
- Locate the
</head>
tag using Ctrl+F (or Cmd+F on Mac). - Paste the following JavaScript code just below the
</head>
tag
<script> /*<![CDATA[*/ (function() { const url = new URL(window.location.href); if (url.searchParams.has('m') && url.searchParams.get('m') === '1') { url.searchParams.delete('m'); const newUrl = url.pathname + url.search + url.hash; if (location.href !== url.href) { history.replaceState(null, '', newUrl); } } })(); /*]]>*/ </script>
- Now save your theme.
Note:
This method only visually hides ?m=1
. Search engines may still index the mobile URL unless canonical tags are set (e.g., <link rel="canonical" href="https://yourblog.blogspot.com/">
). Test in browsers like Chrome and Firefox, as some (e.g., Opera) may not support this script.
If you’re using a custom domain with Cloudflare, the next two methods offer server-side solutions for more robust results. Let's see the Cloudflare methods.
Method 2 & 3: Cloudflare Solutions
For more advanced users with domains connected to Cloudflare, these methods provide cleaner solutions that work before the page loads.
Requirements:- Your domain must be using Cloudflare DNS
- You need a Cloudflare Pro plan (for Workers Routes) or free plan (for basic Workers)
- Some technical knowledge is required
- Proxy must be enabled.
Image: How to enabled Proxy
Warning:
According to Blogger, they do not support Cloudflare integration. So if you do this, you may encounter unexpected issues. Do not try this if you do not have technical knowledge. If you still want to try this, try it at your own risk, I am not responsible if your site goes offline or anything breaks after doing this.
Also, remember that I am not forcing you to do this, if any issues arise, you will be responsible for it.
Method 2: Remove ?m=1 Using Cloudflare Workers
Cloudflare Workers act as middleware to modify responses before they reach users, allowing you to remove ?m=1 permanently by detecting device types and rewriting URLs server-side.
- Log in to your Cloudflare Dashboard.
- Go to Workers Routes > click "Manage Workers" button > click "Get started" on "Start with Hello World!" > Create Worker.
Image: How to create worker - Name your Worker (e.g.,
blogger-m1-redirect
) and deploy the default script.
Image: Manage Worker - Click Edit Code and replace the default script with:
addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)); }); async function handleRequest(request) { const url = new URL(request.url); // Only run on GET requests (safe to redirect) if (request.method === 'GET') { const searchParams = url.searchParams; if (searchParams.has('m') && searchParams.get('m') === '1') { searchParams.delete('m'); // Rebuild the clean URL const cleanUrl = url.origin + url.pathname + (searchParams.toString() ? '?' + searchParams.toString() : '') + url.hash; // 301 Permanent redirect return Response.redirect(cleanUrl, 301); } } // For everything else, proceed as usual return fetch(request); }
- Save and deploy the Worker.
- Go to Websites > Your Domain > Workers Routes > Add Route.
- Set the route to
*stackydesign.com/*
and select your Worker.
Image: Connect route to you worker
Warning:
Blogger doesn’t officially support Cloudflare integration, so test thoroughly. Ensure your site remains accessible and responsive. Exceeding Cloudflare’s free tier limits (100,000 requests/day) may cause downtime.
For a simpler Cloudflare approach, the next method uses URL Rewrite Rules.
Method 3: Remove ?m=1 Using Cloudflare Rules
Cloudflare’s URL Rewrite Rules modify incoming requests to remove ?m=1
without needing extensive coding, making it easier for non-technical users.
- Log in to your Cloudflare Dashboard.
- Navigate to Websites > Your Domain > Rules > URL Rewrite Rules > Create Rule.
Image: Create Rule - Name the rule (e.g.,
Rewrite Blogger URLs
). - Under “If incoming requests match,” select Custom filter expression.
Image: Add code - Click Edit Expression and enter:
http.request.full_uri wildcard "http*://www.stackydesign.com/*" and (http.user_agent contains "mobi" or http.user_agent contains "Mobi")
stackydesign.com
with your actual domain. - Under Path, select Preserve.
-
Under Query, select Rewrite to..., switch from Static to Dynamic and paste the following in the field:
wildcard_replace(http.request.uri.query, "*", "${1}&m=1")
- Save and deploy the rule.
Info:
This method relies on Cloudflare’s proxy and may not work perfectly for all User-Agents. Test across devices to ensure compatibility.
Summary: Which Method Should You Use?
Method | Easy to Use | Requires Custom Domain | Recommended For |
---|---|---|---|
JavaScript | Easy | Not | Beginner Bloggers |
Cloudflare Workers | Very Hard | Yes | Advanced Users |
URL Rewrite Rules | Hard | Yes | Want the easy way |
Conclusion
You’ve just learned how to remove ?m=1
from your Blogger site in three powerful ways.
- Want a quick fix? Use the JavaScript method
- Want the best for SEO? Go with the Cloudflare method
By following this guide, you’re making your blog more SEO-friendly, faster, and professional.
Ready to take your blog to the next level?
Apply one of these steps today and improve your site’s performance right away.
If this guide helped you, don’t forget to share it and help other bloggers too.
Have questions or need help setting this up? Leave a comment below or contact me, I'm happy to help!
Post a comment
The development work of our website is not finished yet, comment from the comment page