Fix for not showing ?m=1 at the end of a Blogger URL
The ?m=1 appears after the permanent url (domain.com/2021/blog-url.html) when entered from a mobile device. This doesn't happen when viewing the input from a computer. Having ?m=1 at the end of your post URL could cause Search Console to detect it as duplicate content.
Search Console can detect that there are two contents with different URL variants, one with and one without ?m=1
You can solve this case in two ways:
- Have the content with ?m=1 automatically redirected through a JavaScript code that you place in the template
- Manually place a 301 redirect to each post with the goal that they go to the URL without ?m=1
What SEO impact does a URL ending with ?m=1 have
It can negatively affect the SEO of your blog because the strength of authority is divided, users who enter from a mobile will be counted in Google Analytics as a different URL and therefore, the authority of your blog will be divided.
Also, Search Console may index and leave the one ending with ?m=1 as the canonical URL.
So that this does not happen, then, I recommend you do the following.
JavaScript code to redirect the URL
The following code will help us so that every time a user enters from a mobile device, it will be redirected to the URL without ?m=1
Copy the code and paste it before the </body> tag of your template.
<script>/*<![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);}; var protocol=window.location.protocol.replace(/\:/g,''); if(protocol=='http'){ var url=window.location.href.replace('http','https'); window.location.replace(url);} /*]]>*/</script>
I recommend you
How to Put Cursor Animation in Blogger this 2022
Redirect Manually
I mean to place a 301 redirect to each entry, and this is done by:
- blogging
- enter configuration
- you look for errors and redirects
- click on custom redirects, then Add
- You paste the URL that ends in ?m=1
- you paste the URL that does not contain this ending at the end (?m=1)
- You place in Permanent and Guards.
- You do this same step with each entry.