Is your ad being displayed inside the table of contents and making your content look not right?
Here, I have a quick solution to fix this issue which can be caused when you are using ads inserter plugin to insert ads and Easy table of contents plugin to generate an automatic table of contents for your WordPress website.
I have noticed this to happen mostly when your post content is small or can happen anytime as well.
Let us take an example from one of the posts on this website,
In the above screenshot, you can see an ad (yes a demo ad) is being inserted inside the table of contents by the Ads Inserter plugin.
Grow your YouTube channel quicker with TubeBuddy.
While the contents have been published correctly as they should have been, but the placement doesn’t seem not quite right.
the reason for ads being inserted inside table of contents
The plugin we are using Ads inserter to insert advertisements into our WordPress website is doing the right job as it is expected to do. Likewise, the Table of contents plugin is also generating the table of content exactly as it is defined to do.
Get $100 Credit on DigitalOcean for Cloud Hosting. Claim Now!
But the ads inserter thinks that table of contents is also a normal content, a paragraph let us say. We need to tell this plugin that it is wiser to skip the table of contents to insert ads in our case.
And the Ads Inserter has this advanced feature available for free just for this reason! We can define where exactly we want our ads to appear and where not.
So if you want to solve this issue, here’s the easy way to solve this:
- open the ads inserter plugin’s page from your dashboard, Settings -> Ads Inserter
- click and open the Settings tab as shown in the following picture
- from the general tab, scroll down until you find – No paragraph counting inside
- add ul and div in this field,
this is what it looks like after I’ve added the new values
blockquote, figure, li, ul, div
Now, save the settings and you are done. Open up or refresh any post that ads inserted inside the table of contents to discover being displayed correctly.
Don't forget to subscribe!.
Did this method work for you?
Grow your YouTube channel quicker with TubeBuddy. Join Today!
Let me know in the comment section below. 🙂