Bookmark

How to Clean Up URLs by Removing ?m=1 in Blogger/Blogspot

When managing a Blogger/Blogspot blog, you might notice the ?m=1 parameter appended to your URLs, you might want to remove it for cleaner URLs and better SEO. This parameter is used by Blogger to render your blog in a mobile-friendly format, but it can be removed if you prefer a different approach.

Why Remove `?m=1`?

  • Improved SEO: Clean URLs are more user-friendly and can contribute to better search engine optimization.
  • Consistent User Experience: Removing `?m=1` ensures that your URLs remain consistent across different devices.
  • Better Analytics: Cleaner URLs make it easier to track and analyze your blog’s performance.

Steps to Remove `?m=1` from URLs

1. Sign in to Blogger

Go to Blogger and log in with your Google account.

2. Access Your Blog’s Template

From the Blogger dashboard, select the blog you want to modify. Navigate to the “Theme” or “Template” section.

3. Edit HTML

Click on the “Edit HTML” button to open the HTML editor.

How to Clean Up URLs by Removing ?m=1 in Blogger/Blogspot

4. Add the Script to Remove `?m=1`

Paste the following script into the <head> section or just before the closing body tag in your template:

<script type='text/javascript'>
//<![CDATA[>
var uri = window.location.toString();
            if (uri.indexOf("?m=1") > -1 || uri.indexOf("&m=1") > -1) {
                var clean_uri = uri.replace(/[?&]m=1/, '');
                clean_uri = clean_uri.replace(/\?$/, '').replace(/&$/, '');
                window.history.replaceState({}, document.title, clean_uri);
            }
//]]>
</script>

5. Save Your Changes

Click on the “Save” button to apply the changes to your template.

6. Test Your URLs

Visit your blog and check various URLs to ensure that `?m=1` has been removed and that your site functions correctly.

Note

  • Backup Your Template: Before making any changes, back up your template by going to “Backup/Restore” in the Theme section.
  • Verify Mobile Responsiveness: After removing `?m=1`, ensure that your blog remains mobile-friendly. You may need to adjust your template’s CSS for optimal display.
Post a Comment

Post a Comment