0:00
What is up guys Abhishek here and in this video I will show you how you can install
0:03
the anti-adblock script in your WordPress website. So recently I make a video on how to install the anti-adblock script for blogger
0:11
But in this video we will learn how we can implement the same anti-adblock script in
0:15
WordPress website. So before that let's understand how it works. So this is a blog post and whenever someone uses adblocker on their browser
0:25
and let me just refresh this page. And so it will show a warning like this to disable the adblocker
0:33
So in this way you can force the user to disable the adblocker on the browser and
0:39
you can generate more ad clicks and impression out of it. So let's check how can implement it in WordPress
0:48
So for this you have to go to your WordPress dashboard and let me just remove that old
0:53
code and let's start how we can implement it from the beginning
0:57
Okay I have removed that old code and let's add it in the WordPress
1:02
So for this you have to go to the appearance section and go to the theme file editor
1:10
So here you have to search for footer.php just click on it
1:14
and scroll down and search for closing body tag. So just click on enter and you have to paste a code like this
1:23
So I will leave this link in the description. So just add this code just above the closing body tag and click on update file
1:33
Now let's go to the post again. So let me just switch to another blog post
1:40
So let's open it. And let me just turn on the adblocker on this browser
1:49
So as you can see the adblocker notice is working perfectly fine
1:54
So let me just disable it again. So you have to add the ID of your blog post
2:04
So let me just click on inspect element. And let's search the ID of the main content and here it is
2:11
This is the main ID so it will cover the whole blog post
2:15
So just you have to copy this ID and here you have to replace the ID like it
2:22
So if this code is not working then you have to change the ID otherwise it will work perfectly
2:28
fine for WordPress. Or you can simply add this code using a code manager plugin
2:33
So I can simply remove this code from here and let me just update file
2:42
Okay now you can add this in footer section by using a code manager plugin
2:47
So for this you have to go to the plugin section and click on the plugin
2:51
And you have to add this in footer section. So let me just add this in footer section
2:56
So for this you have to go to the plugin section and click on add new
3:01
So either you can add it directly in the theme file editor or you can use a plugin
3:06
like header footer code manager. So let's search for this plugin. And here you can install this plugin and with this help of this plugin you can directly
3:21
add the code in the footer section or you can use any other code manager plugin like
3:27
here I am using the pop matters plugin. So it allows me to add code in the footer section
3:33
So I can simply add the code in the footer section like this and click on save changes
3:39
So let me just save this and click on save changes. So in this way you can add the code in the footer section in various ways and you will
3:49
get the download link of this code in the description and don't forget to check the
3:55
ID properly otherwise it will not work in your WordPress theme. And if you have any doubt regarding this then you can ask me in the comment section
4:05
And if you like this content then don't forget to hit the like button
4:11
And also share your feedback how the content is helpful to you and on which topic should
4:18
I make more videos. So thank you for watching this video and I will see you in the next video