How do I remove "?m=1" from url?

Blogger automatically adds "?m=1" to the end of URLs for mobile versions of your blog posts. If you want to remove it, you can follow these steps:

Method 1: Use HTML/JavaScript gadget

  1. Go to your Blogger dashboard.
  2. Select the blog you want to edit.
  3. Navigate to "Layout" in the left-hand menu.
  4. Add a new HTML/JavaScript gadget to your layout.
remove "?m=1" from url?
<script>
var uri = window.location.toString();

// Check if "%3D" is present in the URL and remove it
if (uri.indexOf("%3D", "%3D") > 0) {
  var i = uri.substring(0, uri.indexOf("%3D"));
  window.history.replaceState({}, document.title, i);
}

// Check if "%3D%3D" is present in the URL and remove it
if (uri.indexOf("%3D%3D", "%3D%3D") > 0) {
  var i = uri.substring(0, uri.indexOf("%3D%3D"));
  window.history.replaceState({}, document.title, i);
}

// Check if "&m=1" is present in the URL and remove it
if (uri.indexOf("&m=1", "&m=1") > 0) {
  var i = uri.substring(0, uri.indexOf("&m=1"));
  window.history.replaceState({}, document.title, i);
}

// Check if "?m=1" is present in the URL and remove it
if (uri.indexOf("?m=1", "?m=1") > 0) {
  var i = uri.substring(0, uri.indexOf("?m=1"));
  window.history.replaceState({}, document.title, i);
}

</sccript>
Save the gadget.
This script checks if "?m=1" is present in the URL and removes it if found.

Method 2: Use Custom Redirects

  1. Go to your Blogger dashboard.
  2. Select the blog you want to edit.
  3. Navigate to "Settings" and then "Search preferences."
  4. Look for the "Errors and redirections" section.
  5. Click on "Edit" next to "Custom Redirects."
Add a new redirect with the following settings:

From: /?m=1
To: /
Save your changes.

This method uses Blogger's built-in redirect feature to send users from the mobile URL to the standard one.

After implementing either of these methods, your blog post URLs should no longer have "?m=1" appended to them. Make sure to test it to ensure it's working as expected.

Leave a comment

Previous Post Next Post
×