How to Sell Ad Space on a WordPress Site (Step by Step)
Where to put a banner in WordPress (blocks, widgets, Site Editor templates and synced patterns), when an ad plugin is worth it, and how to price, sell and serve the slot.
On this page
To sell ad space on a WordPress site, pick one placement, paste the banner's HTML into a Custom HTML block there, publish an "Advertise" page with the slot's size and price, and take payment before the ad goes live. For a site-wide slot, the block goes in a widget area such as the sidebar in a classic theme (Appearance → Widgets), or in a template or template part in a block theme (Appearance → Editor). You don't need an ad plugin for one or two directly sold slots; a plugin earns its place when you want ads inserted automatically into existing posts, rotated, or targeted.
Key takeaways
- A Custom HTML block places a banner in a post, a classic theme's widget area, or a block theme's template or template part.
- Save an in-post ad as a synced pattern, and one edit updates every post that uses it.
- Skip the ad plugin for one or two fixed slots; consider one for automatic in-content insertion, rotation or targeting.
- Check the live page logged out: page caches can serve an old ad, and ad blockers hide some banners.
- An Advertise page with the slot's size, price and a booking link does most of the selling.
Step 1: Choose where the ad goes
Start with one or two slots; fewer placements are easier to sell. Here's where each lives in WordPress:
| Placement | Where you add it | Shows on | Good to know |
|---|---|---|---|
| Inside a post | Custom HTML block in the post editor | That post, or many via a synced pattern | Most context |
| Sidebar (classic theme) | Appearance → Widgets, sidebar area | Every page that shows the sidebar | Many themes move the sidebar below the post on phones |
| Below every post (block theme) | Appearance → Editor → Templates → Single Posts | All single posts | Reaches readers who finish the article |
| Header or footer | Header or Footer template part (block theme), footer widget area (classic theme) | Every page | Header: most visible; footer: least |
Use standard sizes, such as 300×250 for sidebars and in-content slots or 728×90 for a desktop header, so advertisers can reuse existing creatives. See our banner ad sizes guide.
Step 2: Add the banner code
A banner is a linked image. This snippet, with placeholder URLs and inline styles, works anywhere WordPress accepts HTML:
<div style="max-width:300px;margin:24px auto;text-align:center">
<p style="margin:0 0 4px;font-size:12px;color:#6b7280">Advertisement</p>
<a href="https://advertiser.example.com/" target="_blank" rel="sponsored noopener"><img src="https://yoursite.example.com/ads/sponsor-300x250.webp" width="300" height="250" alt="Sponsor name: short message" style="max-width:100%;height:auto"></a>
</div>
The width and height attributes stop the page from jumping, and rel="sponsored" marks the link as paid. Our guide to adding a banner ad with plain HTML explains the rest.
In a post: the Custom HTML block
- Open the post, click where the ad should appear, type
/htmlon an empty line and press Enter. - In WordPress 7.0 and later, click Edit HTML, paste the code and click Update. In earlier versions, paste it straight into the block.
- Preview the post, then save it.
For Authors and Contributors, WordPress strips tags like <script> and <iframe> when the post is saved (see the Custom HTML block documentation). A link-and-image banner needs neither.
In many posts: a synced pattern
Rather than pasting the same code into dozens of posts, use a synced pattern (a reusable block before WordPress 6.3):
- Select the Custom HTML block, open the three-dot options menu and choose Create pattern.
- Name it, for example "In-post ad," turn on Synced and click Create.
- In other posts, add it from the Synced Patterns section of the block inserter, or type
/followed by its name.
Editing a synced pattern updates it everywhere it's used; find it later under Manage Patterns in the options menu. Detach turns one copy into a regular block that stops syncing.
Sidebar or footer in a classic theme
- Go to Appearance → Widgets.
- Open the widget area you want, such as Sidebar or Footer.
- Click +, add a Custom HTML block, paste the code and save.
Appearance → Customize → Widgets does the same with a live preview. Synced patterns are turned off in the widgets editor, but a sidebar widget already appears on every page with that sidebar.
Header, footer or below every post in a block theme
Block themes such as Twenty Twenty-Five have no Widgets screen (by design), so open Appearance → Editor:
- Every page: go to Patterns, open the Header or Footer template part, add a Custom HTML block and click Save.
- Below every post: go to Templates → Single Posts, add a Custom HTML block (or your synced pattern) just below the post content, and click Save.
Template changes apply to every page that uses the template.
Do you need an ad plugin?
Not for one or two direct-sold slots in fixed places. A plugin helps when you need something core WordPress doesn't do:
| You want to… | Built-in WordPress | Ad plugin |
|---|---|---|
| Show the same banner in many posts | Synced pattern, added to each post | Inserted automatically |
| Insert an ad after a set paragraph in every existing post | Not built in | Yes |
| Rotate several ads in one slot | Not built in | Yes |
| Hide ads from logged-in users or certain roles | Not built in | Yes, in some plugins |
As of October 2026, established options in the WordPress.org plugin directory include Advanced Ads and Ad Inserter; both can insert ads before or after a chosen paragraph. Each plugin adds code to maintain, so install one only for a feature you need.
Check caching and ad blockers
Page caching
Caching plugins and many hosts serve visitors a saved copy of each page. After you swap a hand-coded ad, cached pages can show the old one until the cache clears, and editing a widget or template part may not clear every page, so purge the whole cache. Logged-in users often bypass the cache, so check in a private window.
A hosted embed sidesteps the problem: its code never changes, so the cached HTML stays correct while the ad server decides which image to return.
Ad blockers
Ad blockers use filter lists such as EasyList, which block known ad servers and hide elements with ad-like class names such as ad-slot and advertise-here, so some readers won't see your banner. Don't disguise ads to slip past blockers; it costs reader trust. Price and report from the impressions your ad tool actually records (see banner ad metrics).
Step 3: Publish an Advertise page
Create a page called "Advertise" and link it from your footer menu: Appearance → Menus in a classic theme, or the Site Editor's Navigation section in a block theme. Cover who reads your site, monthly pageviews and top countries, each slot's size, placement (a screenshot helps), price and minimum booking, what you accept, and a clear way to book. Point any "Advertise here" placeholder at this page, too. Our Advertise With Us page template has copy you can adapt.
Step 4: Price the slot
Price from the slot's impressions, not total pageviews: a sidebar that drops below the post on phones, or a block shown only on single posts, is seen less often than the sitewide number suggests. Then apply:
Daily price = (daily slot impressions ÷ 1,000) × target CPM
Publish the result as a flat daily or weekly rate with a minimum booking length. The full method is in how much to charge for banner ads.
Selling the slot with Spreadiom
That leaves the admin work: dates, payment, creative swaps and reports. Spreadiom handles it around one embed:
- Create an ad slot in the size you want. You get a one-line embed code and a public booking page with an availability calendar.
- Paste the embed once, in any of the places above. Until someone books, the slot shows an "Advertise here" image that links to the booking page.
- Advertisers book as guests. They pick dates, upload a banner that's automatically cropped to the slot size and screened for prohibited content, and pay by card through your own Stripe account or with PayPal straight into your own PayPal account. Spreadiom never holds the money.
- If you turn on approval, a card is only authorized at booking and charged when you approve; PayPal advertisers pay after approval, within 48 hours. Requests you don't review are canceled automatically.
- The booked ad goes live on its start date automatically. You don't edit the block, re-save the template or purge the cache.
Here's the embed for a 300×250 slot:
<a href="https://www.spreadiom.com/ABC-12/link" target="_blank" rel="sponsored noopener"><img src="https://www.spreadiom.com/ABC-12/img" width="300" height="250" alt="Advertisement" style="max-width:100%;height:auto" loading="lazy"></a>
It's plain HTML with no JavaScript and no cookies, so no plugin is needed; in a header slot, you can delete loading="lazy". You see impressions, clicks and CTR per slot, each advertiser sees them on a private booking page, and crawlers and other bots are filtered out. Stripe test keys let you try the whole flow before taking real money.
Spreadiom is free to start. It charges a 5% platform fee on completed (paid, live) bookings, invoiced once a month and paid by PayPal. The fee is never deducted from the advertiser's payment, and Stripe or PayPal processing fees are separate. Create a free account to set up your first slot, or see the pricing page.
FAQ
Do I need a plugin to sell ads on WordPress?
No. For one or two placements, a Custom HTML block in a post, a widget area or a Site Editor template is enough. A plugin helps when you want ads inserted automatically into existing posts, rotated, or hidden from certain user roles.
How do I add a banner ad to a WordPress sidebar?
In a classic theme, go to Appearance → Widgets, open the sidebar area, add a Custom HTML block, paste the banner code and save. Block themes don't have a Widgets screen, so edit a template or template part in Appearance → Editor instead.
How do I show the same ad in every WordPress post?
In a block theme, add a Custom HTML block below the post content in the Single Posts template. In any theme, a synced pattern inserted into each post updates everywhere when you edit it; an ad plugin can insert ads into existing posts automatically.
Why isn't my new banner showing on my WordPress site?
Usually it's page caching: visitors get a stored copy of the page until the cache clears. Purge the cache, check in a private window, and turn off your own ad blocker while testing.
Can I sell ads on a WordPress.com site?
It depends on your plan. WordPress.com's Custom HTML block accepts basic tags such as <a> and <img> on every plan, but scripts and iframes need a paid plan with hosting features activated, and monetization rules vary by plan, so check yours before you sell.
Sell ad space on your site — start free
Give every ad slot its own booking page. Advertisers pick dates, upload a banner and pay by card or PayPal — straight into your own account. No subscription; 5% only on completed bookings.