Skip to content Skip to sidebar Skip to footer

Widget Atas Posting

How to Disable Back Button on Blogger and WordPress

How to Disable Back Button on Blogger and WordPress

- - Post a Comment

The Back button is a button with an arrow icon to the left that you can find in all browsers. The function of the Back button is to make it easier for visitors to return to the page they previously opened.

That way they don't have to remember the URL of the previous page again. The Back button can also be kept pressed until you return to the website you first opened in that tab.

Then why are there bloggers who turn off the back button on their blogs?

If you have visited several blogs, there are indeed bloggers who deliberately turn off the Back button on their blogs.

When clicked, the Back button will not work. In some cases, the Back button will actually redirect visitors to the front page of the blog they are reading.

Then what is the purpose?

It's simple. To make visitors stay on your website longer and reduce the bounce rate .

Visitors who can't hit the Back button are more likely to hit a link that can take them to another page. So turning off the Back button can get them on your site.

This will also indirectly affect the bounce rate of your blog. Because visitors don't leave immediately after reading just one article, turning off the Back button can make the bounce rate low.

Is this method safe?

Honestly I haven't tried it in a long time. However, from some who have tried it, this will indeed reduce the bounce rate and increase the pageviews of their blog.

Then is this script safe for blogs and Adsense?

Logically yes, because we do not do anything that can modify the Adsense code directly. Apart from that there are WordPress plugins that offer this functionality. Maybe not the right indicator, but it feels like it can give you an idea of ​​how safe this method is.

Is there any side effect if we turn off the Back button?

Even if there are negative points, disabling the Back button like this might make some visitors angry.

If they feel that they have had a bad user experience , you might find it difficult to persuade these visitors to come back again. (Unless you can offer what other blogs don't!)

How to Disable Back Button in Blogger and WordPress with JavaScript

To disable the Back button, we only need to use Javascript code.

Even though they can't press the Back button, visitors can still leave our blog by closing a tab, opening a new tab, or writing another website address in the address bar .

1. How to disable Back button in Blogger with Javascript code

If you are using the new Blogger interface, please follow these steps.

  • Login to Blogger
  • Enter the THEME menu
  • Click the three-dot button in the upper right area then select the EDIT HTML menu
  • Click the CTRL+F shortcut then search for tags </head>
  • Copy the following code right above the tag </head>the
<script type = "text/javascript" > history.pushState(null, null); window.addEventListener('popstate', function(event) { history.pushState(null, null); }); </script>

Alternatively, you can also use the code below to redirect the Back button to the front page

<script language='Javascript'>(function(window, location) {history.replaceState(null, document.title, location.pathname+"#!/history");history.pushState(null, document.title, location.pathname);window.addEventListener("popstate", function() {if(location.hash === "#!/history") {history.replaceState(null, document.title, location.pathname);setTimeout(function(){location.replace("");},0);}}, false);}(window, location));</script>

Don't forget to replace the Bisablog blog link above with your own blog URL.

2. How to disable Back button in WordPress with Javascript code

If you have a WordPress blog, the code will be the same. Here are the steps:

  • Login to WordPress dashboard
  • Masuk ke menu THEME ► THEME EDITOR
  • Look for files header.phpin the right column
  • Look for the tag </head>then copy the Javascript code above

If you don't want to bother fiddling with your WordPress theme, you can install a plugin to put code in your WordPress header or footer . With this plugin, you will also never lose your modified code in WordPress. Just install the Insert Header and Footer plugin, then copy the Javascript code above in the menu provided by the plugin.

3. How to disable the Back button in WordPress with a plugin

This is just a learning medium, okay! I myself advise not to install it.

In WordPress, there was once a plugin called Disable Back Button. With this plugin, we can turn off the Back button on the visitor's browser. In addition, we can disable it on the site owner.

Unfortunately, this plugin has only been tested until version 4.9 and is now discontinued . But you can still find this plugin on this page . When tested on localhost, this plugin still works fine. But I still don't recommend installing this plugin on your original website.

Post a Comment for "How to Disable Back Button on Blogger and WordPress"