How to remove ?m=1 suffix from blogger url
Estimated reading time: 1 min
The m=1 or m=0 suffix in Blogger URLs typically indicates that the page is being accessed in mobile view (m=1) or desktop view (m=0). This suffix can appear when a user switches between desktop and mobile versions of a site.
To prevent m=1 from appearing in your Blogger URLs, follow these steps:
Method 1: Add JavaScript to Redirect URLs Without the m=1 Suffix
- Log into Blogger and go to the
Themesection. - Click on “Edit HTML” to modify your theme code.
- Scroll to the
<head>section of your theme and paste the following JavaScript code before the closing</head>tag:<script type='text/javascript'> // Remove ?m=1 or ?m=0 from URLs if (window.location.href.indexOf('?m=1') > -1) { window.location.href = window.location.href.replace('?m=1', ''); } </script>This script checks if the URL contains
?m=1and, if so, redirects the page to the same URL without the suffix. - Save the changes and view your blog. The
m=1parameter should no longer appear when accessing your site on mobile devices.
Method 2: Use Canonical URL to Avoid Indexing the m=1 URL Version
To ensure that search engines do not index the URLs with ?m=1, add a canonical tag in your blog:
- Go to the
Themesection of your Blogger dashboard. - Click on “Edit HTML”.
- Find the
<head>section and add the following code:<link rel="canonical" href="https://www.yoursite.com" />- Replace
https://www.yoursite.comwith your site’s main URL.
- Replace
- Save the changes.
This canonical tag tells search engines that the main version of your blog is without the m=1 or m=0 suffix.
Method 3: Modify the Blogger Mobile Template Settings
- Go to Blogger Dashboard.
- Navigate to Theme.
- Click on the “Customize” button.
- Under Mobile, set the option to “No. Show desktop theme on mobile devices”.
- Save the settings.
This way, your blog will not switch to the mobile view, thus eliminating the ?m=1 parameter.
Additional Notes
- Clearing Browser Cache: If you still see the
?m=1parameter after making changes, try clearing your browser cache or accessing the site in incognito mode. - URL Rewrite: Blogger doesn’t have direct access to .htaccess or URL rewrite configurations, so removing the
m=1is best done using JavaScript or theme settings as described above.