With WordPress, it has now become very easy to create and run a site without any hurdles as its interface is very easy to use. When it comes to placing ads on your WordPress site, it’s also another easy task as most of the themes provide the ad management portion or you can manually insert the tags using the theme editor. But, what if you don’t wanna show ads on any single or individual post? However, WordPress or any theme doesn’t provide the option to remove ads from any specific page, but still, it can be done very easily.
Guys, here I will show you, how can you remove ads from any specific post on your WordPress blog. Whether you’re a beginner or not, you will easily be able to disable ads from any individual post using this guide.
How to Remove Ads from Individual Posts in WordPress
Actually, I’ve compiled two different methods for disabling ads from individual posts. One method is all about using a function reference code manually to restrict the ad code running on the specific page and the other method is plugin method that is more easier.
Well, I’ve tried both of these methods but now I manually insert PHP code for disabling the ads on the pages or posts I want.
Method #1: Using the PHP Function Reference
If you’re a beginner to coding or PHP, it may a new code for you but if you’re familiar with PHP language and its function references, you would know about it. So, look at the following code to remove ads from any individual post.
<?php
if (! is_single($Post))
{ ?>
PLACE Ad CODE HERE
<?php };?>
In the above code, replace $Post with the Post ID of that post if you wanna remove ads and place the code by replacing “PLACE AD CODE HERE”. So, the above code will restrict serving ads on the post whose post ID you will replace with $Post.
Read: How to Increase Your Adsense CTR Effectively
If you don’t wanna show ads on side for that specific post, simply use the above code for the sidebar widget too but as you know the Text box widget won’t support PHP, so you need to install a plugin PHP Text Widget and as soon as you will activate this plugin, your default Text widget will start supporting PHP also.
Method #2: Remove Ads on Specific Posts Using Quick Adsense Plugin
The Quick Adsense WordPress plugin is very helpful, especially for beginners. It makes placing the ads on your site very easier in which you don’t need to be careful about anything.
Just, install and activate the plugin in your WordPress blog and it will let you place ads on your website anywhere you want.
This plugin also lets you remove ads from any individual post. But for this, it is necessary to place ads on your whole website using the same plugin. So, if you’ve placed the whole ads on your website using the QuickAdsense plugin, you can use the following tags for removing ads from any individual post.
That’s all. I hope the above methods will help you remove ads from individual posts in your WordPress blog or website. If still you’re having problems in disabling ads from any of your posts, feel free to let me know so that I can help you.
My ads show in beginning and end of post so I put this cod in Text view in end of post but it`s shows ads. Maybe I must put it in functional.php or if (! is_single(68)) this numder of post is not correct?
This code not working in the post 🙁
It worked for me and should work for all. I can’t understand why it is not working at your end. May be you are placing it at wrong place.
Where must I put code from method 1 ?
You should place this code in your ads management widget (or where you wanna place the ads) of your theme and do whatever I told to do in method 1.
Hello Raman, please tell me if you’ve tried the QuickAdsense plugin. I wanna insert different ads in different posts and this code can’t help me a lot in that case.
So, tell me QuickAdsense Works nice or not and how much time it will take to setup..?
Yes Mohar, it’s really great plugin and I’ve tried it myself. It saves you from writing the lines of code.
So, just install activate the QuickAdsense plugin, insert ad codes, assign position to them. It has many more features and I’m sure that you will definitely love this plugin after using it once.
You can setup the plugin in less than 1 minute as it makes everything very easy.