How to remove ?m=1 and ?m=0 in blogger

Remove ?m=1 2023: Learn how to remove ?m=1 and ?m=0 to show blogger site in a professional manner.
3 Step to remove ?m=1 and ?m=0 in blogger

When you view your Blogger site on a desktop, the URL looks clean, like `https://www.yourblog.com`. But on mobile, you often see `https://www.yourblog.com/?m=1`. This `?m=1` parameter can be a minor annoyance and doesn't look very professional. This guide will show you how to remove the `?m=1` parameter from your Blogger URLs without affecting your SEO.

Why Remove ?m=1 from Blogger URLs?

While `?m=1` doesn't directly hurt your SEO, removing it offers a few benefits:

  • Cleaner URLs: URLs without `?m=1` look more professional and user-friendly.
  • Improved User Experience: Cleaner URLs are easier to share and remember.
  • Consistency: Having consistent URLs across all devices is generally a good practice.

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

Removing `?m=1` involves adding a small piece of JavaScript code to your Blogger template. Here's how:

Step 1: Access Your Blogger Theme

Go to your Blogger dashboard. In the left-hand menu, click on "Theme."

Step 2: Edit HTML

On the Theme page, you'll see a "Customize" button. *Do not click this.* Instead, look for a small dropdown arrow next to the "Customize" button. Click the arrow, and then select "Edit HTML" from the dropdown menu.

Step 3: Add the JavaScript Code

In the HTML editor, find the `` tag. It's usually near the top of the code. Paste the following JavaScript code *immediately* after the closing `` tag:

<script>
/*<![CDATA[*/
var uri = window.location.toString();
if (uri.indexOf("%3D","%3D") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("%3D"));
window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("%3D%3D","%3D%3D") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("%3D%3D"));
window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("&m=1","&m=1") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("&m=1"));
window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("?m=1","?m=1") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("?m=1"));
window.history.replaceState({}, document.title, clean_uri);
}
var protocol=window.location.protocol.replace(/\:/g,'');
if(protocol=='http'){
var url=window.location.href.replace('http','https');
window.location.replace(url);
}
/*]]>*/
</script>

Step 4: Save Changes

Click the "Save" icon (it looks like a floppy disk) in the top right corner of the HTML editor.

Important Considerations

  • Backup Your Theme: Before making any changes to your theme's HTML, it's *highly recommended* to create a backup of your theme. This will allow you to restore your theme if something goes wrong. You can usually find a "Backup/Restore" option on the Theme page.
  • HTTPS Redirect: The provided JavaScript code also includes a redirect from HTTP to HTTPS. This is important for security and SEO. Make sure your blog is set up to use HTTPS in your Blogger settings.

Testing and Verification

After saving the changes, visit your blog on a mobile device or use your browser's developer tools to simulate a mobile view. The `?m=1` parameter should no longer appear in your URLs.

Conclusion

Removing `?m=1` from your Blogger URLs is a simple but effective way to improve the look and feel of your blog on mobile devices. By following these steps, you can ensure a cleaner and more professional experience for your visitors.