How to Remove URL Parameters (m=0 and m=1) on Blogger Post or Pages

How to Remove URL Parameters (m=0 and m=1) on Blogger Post or Pages

How to Remove URL Parameters (`m=0` and `m=1`) on Blogger Pages

If you're using Blogger and want to clean up URLs by removing certain parameters like m=0 and m=1, you can use a simple JavaScript code snippet. This script will automatically clean up these parameters from the URL, ensuring a cleaner and more user-friendly link.

Adding the Script to Your Blogger Page

  1. Log in to your Blogger account.
  2. Go to the Dashboard of the blog you want to edit.
  3. Click on "Theme" in the left sidebar.
  4. Next to "Customize", click on "Edit HTML".
  5. In the HTML editor, locate the closing </body> tag. This is typically found towards the end of the HTML code.
  6. Paste the following code snippet just above the closing </body> tag:

Code Snippet

Here's the JavaScript code you need to add:

<script type='text/javascript'>
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 uri = window.location.toString();
if (uri.indexOf("&m=0","&m=0") > 0) {
    var clean_uri = uri.substring(0, uri.indexOf("&m=0")) + uri.substring(uri.indexOf("&m=0") + 5);
    window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("?m=0","?m=0") > 0) {
    var clean_uri = uri.substring(0, uri.indexOf("?m=0")) + uri.substring(uri.indexOf("?m=0") + 5);
    window.history.replaceState({}, document.title, clean_uri);
}
</script>
        

Conclusion

By following these steps, you can easily clean up unwanted URL parameters from your Blogger pages. This makes your URLs cleaner and more user-friendly. If you have any questions or need further assistance, feel free to ask!

Comments

You may also like..

Yayınlar yükleniyor...

Popular posts from this blog

How to Fix Issues Accessing Google Password Manager on Your Devices

The Interaction Between Google Chrome and Internet Speed

Top 10 Most Anticipated TV Series of 2025

10 Fascinating Events in History

Top 10 Social Media Sites: Connect and Share

Mobile Advertising: Targeting Mobile Users with Google Ads

World's Top 100 Universities

Leveraging Google Sheets IMPORTDATA Function for SEO Data

What is Google Workspace?

Future Trends in Google Shopping