Customize exactly where ads do or don’t show on your website.
If you’re comfortable, you can take the following steps to further customize where ads appear on your site. These are advanced options from the basic ad placement settings.
Control placement of header ad
You can control the placement of the header ad by following these steps:
- Make sure that Additional ad placement is turned on for the Top of each page in basic ad placement settings.
- Add
do_action( 'wordads_header_ad' );
to your theme file directly, or child themes if you are not using a custom theme on your site.
Anywhere the wordads_header_ad action gets called in your theme is where the top/header ad will be displayed.
If that code snippet gets added more than once to your theme, only one top header ad will be displayed.
Prevent ads in certain places
You can also add custom filters to your functions.php file to disable ads in certain locations:
- Disable ads from displaying at the bottom of posts
- Disable ads from displaying at the top of your site
- You can find more filters in this WordAds.co post and combine those with conditional tags to remove ads on specific pages.
Still need help?
Please contact support. We’re happy to advise.