Today's discussion is about how to remove the text ?m=1 at the end of the site link when visiting the blog site from a mobile device. You can solve this problem very easily with a small code. So let's find out.
Remember, ?m=1 never comes at the end of the link while browsing on computer, only when browsing on mobile, the text ?m=1 comes with the blogger link.
Follow below steps to remove ?m=1 from blogger link
Step - 01 : First copy the Html code from below, then follow (Step - 1 & 2).
<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>
Step - 02 : Now you go to Theme option from your blog dashboard. From here, click on the small triangle icon next to Customize and select Edit Html.
Step - 03 : Now find the </body> tag by pressing ctrl+F from the keyboard. Then save the copied code above the </body> tag.
0 Comments
Your comment helps to inspire and motivate a blogger to write something better, so please don't forget to give your feedback after reading each post.
Emoji