If you've noticed ?m=1
appearing in your Blogger URLs when viewed on mobile devices, you're not alone. This parameter forces the mobile template, often creating duplicate content issues that hurt your SEO and sometimes affecting user experience.
In this guide, I'll show you three effective methods to remove ?m=1
:
- JavaScript solution (works for all users)
- Cloudflare Workers (advanced)
- Cloudflare Workers Routes (alternative)
Why You Should Remove ?m=1
The ?m=1
parameter is Blogger's way of serving mobile versions of your site. While useful in some cases, it creates several problems:
- SEO Issues: Search engines may index both versions as separate pages (desktop and mobile), causing duplicate content.
- Performance Impact: Extra redirects slow down your site.
- Analytics Problems: Traffic gets split between URLs, making reports less accurate.
Example URLs
- Before:
https://yourblog.com/post-title/?m=1
- After:
https://yourblog.com/post-title/
Method 1: Remove ?m=1 Using JavaScript
This solution works for all Blogger sites without requiring any server-side changes:
-
Access Your Blogger Template
Go to Theme → Edit HTML in your Blogger dashboard.
-
Add the JavaScript Code
Find the
</head>
tag and paste this code just before it:<script> // Remove ?m=1 parameter if(window.location.href.indexOf('?m=1') > -1) { var cleanUrl = window.location.href.split('?')[0]; window.history.replaceState({}, document.title, cleanUrl); } </script>
-
Save Your Template
Click Save to apply the changes.
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.
- 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
Method 2: Using Cloudflare Workers
-
Create a New Worker
In your Cloudflare dashboard, go to Workers → Create a Worker.
-
Add the Worker Code
Paste this JavaScript code:
addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }) async function handleRequest(request) { const url = new URL(request.url) // Remove ?m=1 parameter if(url.searchParams.has('m')) { url.searchParams.delete('m') return Response.redirect(url.toString(), 301) } return fetch(request) }
-
Deploy the Worker
Save and deploy the worker, then set up a route for your blog (e.g.,
yourblog.com/*
).
Method 3: Using Cloudflare Workers Routes
-
Go to Workers Routes
In Cloudflare, navigate to Workers → Routes.
-
Add a New Route
Create a route pattern like:
yourblog.com/*?m=1
-
Configure the Route
Select the worker you created in Method 2 and save.
Conclusion
Removing ?m=1
from your Blogger URLs improves SEO, performance, and user experience. While the JavaScript method is simplest, Cloudflare solutions offer more professional results.
Choose the method that fits your technical level:
- Beginners: Use Method 1 (JavaScript)
- Advanced users with Cloudflare: Methods 2 or 3
Implement one of these solutions today to clean up your Blogger URLs and boost your site's performance!
/remove-mobile-parameter-blogger-seo
Post a comment
The development work of our website is not finished yet, comment from the comment page