How to Remove ?m=1 From Your Blogger Site in 3 Ways

Learn how to permanently remove ?m=1 from your Blogger URL to improve SEO and performance. Includes JavaScript and Cloudflare solutions.

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:

  1. JavaScript solution (works for all users)
  2. Cloudflare Workers (advanced)
  3. 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:

  1. Access Your Blogger Template

    Go to ThemeEdit HTML in your Blogger dashboard.

  2. 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>
  3. Save Your Template

    Click Save to apply the changes.

Note: This solution removes the parameter after the page loads, so there's still a brief moment when the URL contains ?m=1.

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

Method 2: Using Cloudflare Workers

  1. Create a New Worker

    In your Cloudflare dashboard, go to WorkersCreate a Worker.

  2. 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)
    }
  3. 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

  1. Go to Workers Routes

    In Cloudflare, navigate to WorkersRoutes.

  2. Add a New Route

    Create a route pattern like: yourblog.com/*?m=1

  3. Configure the Route

    Select the worker you created in Method 2 and save.

Pro Tip: The Workers solution provides a 301 redirect, which is better for SEO as it tells search engines the mobile parameter is unnecessary.

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