Free tools Windows power users keep installed
One-click scans. No signup required.
To show ads on selected WordPress posts only, choose the method that matches your workflow: insert a block or shortcode in each post, configure an ad-management plugin with an individual-post condition, or add a template conditional that checks the post ID or slug. For Google AdSense, manual ad units provide the most predictable placement; Auto ads require separate exclusion checks because Google chooses placements independently.
Choose the right method
| Method | Precision | Maintenance | What you need |
|---|---|---|---|
| Block or shortcode in each post | Exact position in each selected post | Higher when the list of posts grows | Editor access and a supported ad block or shortcode |
| Ad-management plugin | Post-level rules plus centrally managed placements | Moderate; manage rules in one dashboard | A plugin whose current conditions include individual posts |
| Theme conditional | Exact code-level control | Lower day-to-day editing, but requires code maintenance | Theme or child-theme access and a safe ad-rendering method |
Use per-post blocks for a small fixed list
Edit each selected post in the block editor and insert the site’s approved ad block or shortcode where the ad should appear. This is the simplest approach when only a few posts need ads and their placements differ. The block or shortcode must be supported by your ad provider and site configuration; script handling varies between plugins, themes and consent tools.
Use a plugin for centralized control
Ad-management plugins can create one placement and apply it only when a condition matches an individual post. The WordPress directory listings for Advanced Ads and Ad Inserter describe features such as placements, exclusions, shortcodes, Gutenberg blocks and post-level targeting. Plugin screens and condition names change, so confirm the current documentation before enabling a rule.
Use a template conditional for custom behavior
In a classic theme, put the ad-rendering call in the single-post template at the location where it belongs, then guard it with is_single():
<?php if ( is_single( array( 123, 'example-post' ) ) ) : ?>
<!-- Render your approved ad unit or site shortcode here. -->
<?php endif; ?>
Replace 123 and example-post with the selected post IDs or slugs, and replace the comment with your actual rendering method. WordPress documents is_single() as determining whether the query is for an existing single post; it accepts a post ID, title, slug or array, but it does not match Pages. See the WordPress function reference.
#1 Best Overall
If Pages or custom post types must also match, use an appropriate is_singular() check instead. Conditional query tags must run after WordPress has prepared the query, so do not call is_single() too early in functions.php. The Conditional Tags section of the Theme Handbook explains the timing and differences.
Configure AdSense without losing post-level control
Manual ad units
Google’s AdSense setup guidance distinguishes manual ad units from Auto ads. A manual unit lets you choose the ad type, size and location, but you must insert it in every intended post or in a conditional/plugin placement that targets those posts.
Auto ads
Auto ads let Google select placements when it estimates they will perform well and provide a good user experience. Enabling a manual unit in a post template does not, by itself, stop separately enabled Auto ads from appearing on other pages. Review AdSense’s current page-exclusion controls and inspect representative non-post pages before relying on an “only these posts” requirement.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Policy and insertion requirements
Ad placement remains subject to Google’s policies. Check the current Ad placement policies for the format and page design you use. Google also documents WordPress insertion approaches in Insert ad unit code into your WordPress site.
Verify that ads appear only where intended
- Open one selected post and confirm the ad slot appears at the intended location after scripts, consent and caching have loaded.
- Open an unselected post and confirm the slot is absent.
- Check a Page, the homepage, category and tag archives, and search results.
- If a plugin is involved, inspect every global header, sidebar and site-wide placement so another rule is not adding the ad.
- If Auto ads are enabled, verify the relevant AdSense exclusions and repeat the checks on representative non-post pages.
- Re-test after changing the theme, ad plugin, consent settings, caching or AdSense configuration.
Troubleshoot common mismatches
The ad appears on every post
Look for a site-wide plugin placement, a global widget, an ad in the single-post template without its conditional, or Auto ads running independently. Disable or narrow the extra placement, then retest an unselected post.
Rank #2
The selected post has no ad
Confirm the ID or slug, the plugin’s condition and placement status, and whether caching or consent prevents the script from loading. View the page source or browser tools only as needed to determine whether the container is missing or the provider script is being blocked.
Pages are incorrectly targeted
is_single() is for individual posts, not Pages. Replace it with a deliberate is_singular() condition only when Pages or a specified custom post type should be included.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

