How to Remove ?m=1 from Blogger url

As you know, Blogger shows ?m=1 in the URL when someone visits the blog from mobile devices. It looks a little odd, and most users don’t like this.
Maintaining a clean URL lends a professional aesthetic to your BLOG, and you certainly wouldn’t want distinct URLs for both desktop and mobile devices.A blog sporting an identical URL demonstrates professionalism and bolsters its search engine friendliness

Desktopwealthytrench.com

Mobile : wealthytrench.com/?m=1

So, In this blog, I will show you how you can Delete the ?m=1 URL parameter from your Blogger website. I will also tell you should you implement this on your website or not. 

first, go to the Edit HTML is located in blogger thems
then search  tags by clicking  ctrl + F key

removem1blogger

Next, insert the JavaScript code just before the closing  tag, as shown in the example provided in the image below

removem1blogger
<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>

Leave a Reply