How to permanently remove ?m=1 from Blogger Blog

Many of you asked me a lot of times about getting rid of the 'm' parameter from blogger blog url. Even though there is no problem with this parameter, people want to remove it from the url. Currently there is no native way to remove it, but there is a workaround to do this. Using Cloudflare Workers as middleware, we can modify the response before it reaches to user. What we can do is detect the device type (i.e. 'mobile', 'tablet' or 'desktop') using 'User-Agent' request header and fetch the origin with 'm' parameter with value based on the device type ('0' for 'desktop' and '1' for others) and send it back to the user. By doing this, user will no longer get redirected to the url with 'm' parameter when visited on mobile devices. This process requires Custom domain routed to a Cloudflare Workers which means you need a Custom Domain integrated with Cloudflare. Therefore, we can't do the same for .blogspot…

About the author

~ Hello World!

6 comments

  1. Admin
    please help me to fix this problem after i add this code to my website it show link in desktop www.exemple.com/?m=0
    1. Deo K.
      I have been using the same code for more than a year and I never faced such issue. I need more information in order to get it fixed.
    2. DESLAB
      I also had the problem that after using the code, ?m=0 was added in the desktop
    3. DESLAB
      remove return "desktop"; will fix it
    4. Deo K.
      If you see ?m=0 after only opening a post url from homepage, it is probably the link itself containing the ?m=0 in its href attribute.
    5. Admin
      this issue happen too on your website when click on certain labels in right sidebar