How To Remove ?m=1 from URL in Blogger/Blogspot

How To Remove ?m=1 from URL in Blogger/Blogspot
To remove the ?m=1 parameter from the URL in Blogger/Blogspot, follow these steps:

What is ?m=1?

The ?m=1 parameter appears when you access your blog on mobile devices, as it indicates the mobile version of the page. While it doesn’t affect the content or functionality, removing it can make URLs cleaner and improve SEO.

Steps to Remove ?m=1 from Blogger URLs:

1. Login to Your Blogger Account:

2. Navigate to the "Theme" Section:

  • In your Blogger dashboard, click on the "Theme" option on the left sidebar.
  • Select the "Edit HTML" button under your active theme.

3. Add Custom JavaScript Code:

  • Scroll down to the </head> tag within the HTML editor.
  • Right before this tag, add the following JavaScript code:
<script type="text/javascript"> if (window.location.href.indexOf('?m=1') > -1) { window.location.href = window.location.href.replace("?m=1", ""); } </script>

This script checks if the ?m=1 parameter is in the URL. If it is, the script reloads the page without the parameter.

4. Save Your Changes:

  • After adding the script, click the "Save" button to apply the changes.

5. Test Your Blog:

  • Visit your blog on a mobile device and check if the ?m=1 parameter has been removed from the URL. Ensure your mobile site loads properly.

Optional: Disable Blogger’s Mobile Version

If you don't need a separate mobile version of your blog and want it to load the desktop view on all devices, you can disable the mobile version.

Steps:

  • Go to Theme in your Blogger dashboard.
  • Click the gear icon under Mobile.
  • Choose "No" for the option that says, "Show mobile theme on mobile devices."
  • Save the changes.

Benefits of Removing ?m=1:

  • Cleaner URLs: Makes your blog's URLs more user-friendly and professional.
  • SEO Impact: Clean URLs can contribute positively to your blog's SEO and avoid potential indexing issues with duplicate content (mobile vs. desktop versions).

By implementing these steps, you can ensure a consistent and clean URL structure for your blog on both desktop and mobile devices.


If it is not Working then try the second method:

Copy the code given below and paste it just before the </body> and finally click on Save file. 

<script type='text/javascript'>
//<![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);
}
//]]>
</script>

Post a Comment

0 Comments