How to Romove ?m=1 String From Your (Blogger) Blog Url

Have you ever noticed ?m=1
at the end of your blog URL when viewed on a mobile device? This happens because Blogger automatically appends this parameter to indicate that the page is in mobile mode.
While this doesn’t affect your blog’s performance, it can create issues like:
- Duplicate URLs: Search engines might index both versions, leading to duplicate content problems.
- Messy Links: The extra string makes your URLs look cluttered and unprofessional.
- Sharing Problems: If a visitor shares a mobile URL, desktop users might still see the mobile version.
The good news? You can easily remove ?m=1
with a simple JavaScript code. Follow the steps below to clean up your Blogger URLs.
How to Remove ?m=1
from Blogger URLs
To stop Blogger from adding ?m=1
to your URLs, just add the following JavaScript snippet inside your blog’s theme.
Steps to Implement:
- Log in to your Blogger Dashboard.
- Go to Theme > Click Edit HTML.
- Find the
<head>
tag by pressing Ctrl + F and searching for<head>
. - Just below the
<head>
tag, paste this script:
<script>/*<![CDATA[*/ var uri = window.location.toString(); if (uri.indexOf("?m=1") > 0) { var clean_uri = uri.substring(0, uri.indexOf("?m=1")); window.history.replaceState({}, document.title, clean_uri); }; /*]]>*/</script>
- Save your template and refresh your blog.
How Does This Code Work?
Here’s a quick breakdown of what the script does:
- Reads the current URL: It checks if the URL contains
?m=1
. - Removes
?m=1
: If found, it strips out the extra string. - Updates the URL dynamically: It refreshes the browser’s address bar without reloading the page.
Additional Tips
- This script does not disable Blogger’s mobile-friendly design—it only removes
?m=1
from the URL. - If you want to completely turn off the mobile version, go to Theme > Mobile Settings and set it to "Desktop Mode."
- Ensure your blog is mobile-responsive so visitors still get a good experience on smaller screens.
Final Thoughts
By following these steps, you can keep your Blogger URLs clean and professional. No more unwanted ?m=1
cluttering your links!
If you found this guide helpful, feel free to share it with others. Happy blogging!
Post a Comment