How to Add Ads to WordPress and Place the Code
To add ads to WordPress, first check who hosts the site and which insertion methods the account allows. Give one approved integration responsibility for site-wide code. Then place the individual ad unit where it should appear and verify the published output, including consent and behavior on a page that should stay ad-free.
By FroggyAds, November 27, 2026
How do you add ads to WordPress?
Start on an authorized site with one publisher account and one approved placement. Confirm that the host, site plan, user permissions and ad provider allow the integration you intend to use. Decide whether you need an automatic placement program or a manually placed ad unit. That choice determines what code you need and which templates may change.
Identify the exact domain and check the publisher's approval status. A connection tool or verification snippet can help the provider recognize the site. Advertising availability still depends on the provider's site and account state, the consent path and the approved placement. Retain the provider's account name and the intended next change together.
Write down the original state before installing anything. Identify who maintains the theme, who can change a plugin setting, which pages may show the unit and who can disable it. The wider decision about monetizing WordPress includes audience and revenue choices beyond this setup. FroggyAds guide to monetizing WordPress
Which product, plan and theme are you using?
WordPress.com is a hosted service with plan-specific controls. A site maintained on another host using WordPress software has its own host rules, WordPress roles and supported editing paths. Ask the site owner where the site is managed and which account can install or change an approved integration. The appearance of the editor alone gives little information about what the host permits.
WordPress.com describes WordAds as its own advertising program for eligible sites on Premium and higher plans. Its support also describes using a third-party publisher service through a separate integration. Check the exact plan and activated hosting features before depending on a plugin or custom JavaScript. Its current header-code help includes the Personal plan and higher plans for the supported plugin method. WordAds has separate site and domain conditions. WordPress.com monetization and advertising support
| Site or setup | First decision | Where to verify the output |
|---|---|---|
| WordPress.com with eligible WordAds | Confirm the plan, site eligibility and provider controls for the built-in program | Logged-out preview or approved page and the program's own settings |
| WordPress.com with a third-party service | Confirm the plan, activated hosting features, permitted plugin and publisher approval | The hosting settings and delivered page from the exact intended domain |
| Another host with a block theme | Choose an approved plugin or one page or template placement under the available access | One target page plus another page that uses the same template or a different one |
| Another host with a classic theme | Check whether the theme exposes a suitable widget area or needs an approved placement plugin | Actual page output with the theme's active layout, including its mobile version |
With a block theme, WordPress documents Appearance, then Editor, as the entry to the Site Editor. A header or footer template part may be shared across many pages. Check which routes use that part before saving an ad placement there. On a classic theme, an available widget area depends on the theme. Ask the theme owner to identify it and the pages it affects. WordPress.org Site Editor documentation
Where does ad code in the header go?
Use the generated HTML document head for a provider's site-wide script when its instructions specify the head. A visible WordPress Header template part contains things the reader sees, such as the site title and navigation. A manual display ad unit belongs in the approved position in the document body. Determine which of those surfaces the provider expects before choosing a WordPress editor or plugin.
Google AdSense's code instructions distinguish the site-wide AdSense snippet from the code for a specific ad unit. The site-wide placement guide uses the document head. The manual unit guide shows the code in the body at the selected placement. Use the current code generated for your own property through the provider's supported path. Google AdSense guide to getting the correct code
For an eligible WordPress.com site following its documented manual header route, the guide uses the Insert Headers and Footers plugin by WPCode. The authorized owner opens Code Snippets, then Header & Footer, and uses the Header field for the provider's approved head snippet. This setting can affect many routes, so check the exact placement rules, consent timing and other existing snippets first.
On a self-managed WordPress installation, use the approved network plugin or the host and theme owner's maintained integration for the site-wide snippet. Preserve the parent theme files. Ask the maintainer which integration writes the actual document head, and inspect the output to confirm it. The visible Header part and shared navigation need no edit when the goal is to add only the document-head snippet. FroggyAds guide to what an ad tag does
Give one tool responsibility for the shared snippet
Check existing ownership before enabling a second tool. A provider plugin, an older header-code plugin and a theme setting can each insert a similar site-wide snippet. Compare the generated source on a representative route and inspect the relevant settings. Record one authority for the selected service, then confirm the provider supports the expected connection with that owner.
Google's Site Kit can connect AdSense and place code when configured to supply it. Its setup flow can detect existing code from other sources. A publisher who already has a maintained snippet should resolve that existing owner before turning on another insertion method. If the account is intended to use specific manual units, verify which ads and pages are enabled in the provider configuration. A connection and automated placement are separate decisions.
Keep the provider-issued code in its supported format. When a plugin already manages the shared script, use its documented method for the ad unit. Avoid cutting a generated snippet into pieces to fit an editor. Report an incompatible setup to the site maintainer and preserve its existing layout and access rules.
Place one unit on a page you can check
For a manual unit, create or select the authorized display unit in the publisher account. Give it a name your team can match to the target WordPress page and intended position. Use the permitted placement plugin, theme widget or page-level block for that unit. A Custom HTML block may strip scripts or iframes when the current editor lacks the necessary capability. Use the supported route available to the owner.
In a fictional photography tutorial, a publisher wants one ad after a group of settings examples. Its checkout and contact form must stay clear of the new ad. The site uses a block theme, and the selected tutorial uses a shared post template. An editor first proposed placing the unit in a shared header part. A review identifies every page using that part and moves the proposed unit to the individual tutorial through a supported placement setting.
The review also finds an older header setting that already inserts the approved service snippet. The owner has introduced no second snippet in the proposed setup. Confirm the same approved shared setup for pages where it is expected and within the allowed consent state. Then isolate the new unit to the test page. If automatic placements are enabled elsewhere, confirm their exclusions independently before accepting that checkout stays clear. FroggyAds guide to publisher display placements
Check consent and the actual delivered page
Agree with the consent owner what the provider may load for each user choice and target region. A consent management platform records or applies a visitor's choices. Google's publisher help explains certified platform and IAB Transparency and Consent Framework requirements for personalized ads in the European Economic Area, the U.K. and Switzerland. Check the current provider rule and the site's approved handling before any live request. Google publisher consent requirements
| Controlled observation | What it should establish |
|---|---|
| Logged-out target page | Correct current page and ad unit position at the approved viewport |
| Logged-out checkout or contact route | The new unit is absent and the intended automatic-placement exclusions apply |
| Consent granted under approved rules | The expected provider behavior and requested unit match the publisher's conditions |
| Consent withheld or changed | Only the site's approved request and storage behavior occurs |
| Provider response is empty | The document, navigation and placement layout remain usable |
Check the delivered page as well as the editor preview. Compare source markup for an initial snippet and the rendered document for any code inserted after a permitted action. Use the browser's network log on the authorized test site or preview to inspect the expected request. Match the exact domain, page, publisher reference and the unit you meant to test. A code field saved in WordPress is only one of those observations.
Some previews omit scripts and some published responses may still be cached. Verify the page revision and use the host's authorized cache process before diagnosing a missing or duplicate snippet. A clean request can still return no creative under the provider's review, consent or availability conditions. Keep those causes separate and use the provider's approved diagnostics. Avoid interacting with live ads to test display. When the new unit can appear more than once on a template, check the actual rendered ad area on the different widths before expanding it. FroggyAds guide to checking ad density
If you have a separate eligible FroggyAds advertising campaign, we can help you define a supported format and accepted business outcome. Check the destination and its publisher policies before buying traffic.
How do you remove the test cleanly?
Disable the individual placement through the same editor or plugin that owns it. Verify that the target page and a control page behave as intended afterward. If another approved unit still uses the shared integration, keep that shared setting with its existing maintainer.
If the change added a dedicated site-wide snippet, decide whether anything else now relies on it before restoring the recorded previous setting. Recheck the live or authorized preview after the current revision is served. Confirm that the test's targeted markup and resulting requests are absent in the tested state while the page's other approved functions still work.
Frequently asked questions
Can I add my own ad code to a free WordPress.com site?
The documented WordPress.com plugin route for third-party head code requires an eligible paid plan. Free sites have restrictions on scripts and plugins. WordAds follows its own plan and site eligibility rules.
Can a paid WordPress.com plan always run WordAds?
WordPress.com documents WordAds for Premium and higher plans and lists separate eligibility requirements for the site and its primary domain. Confirm participation for the specific site with the built-in program before expecting a display or payment.
Does ad code go in the visible WordPress Header?
The provider may request site-wide code in the HTML document head. A visible Header template part is content in the body and can be shared across pages. Inspect the published source to confirm the code is in the intended document position.
Can I put a display ad unit in a Custom HTML block?
Use a block only when the site, role and provider permit that code. WordPress can filter scripts from accounts with limited permissions. An approved provider or placement plugin may be the supported route for the same page-level unit.
Can Site Kit and another plugin both place the same site-wide code?
Give one integration ownership of the shared snippet. Find any other place that already inserts the same service code before enabling another. Check the provider's current setup and preserve unrelated integrations.
Where should the unit go on a block theme?
Choose the position and scope in the page or permitted template. Review which pages use that template before placing a unit in a shared part. Test at least one intended page and one page expected to stay outside the placement.
What if the code is present and the ad remains blank?
Check site approval, consent state, permitted placement and the provider's eligible response. Verify which route and unit the request names. A rendered container or script tag establishes only the relevant part of the setup.
Can I skip a consent test while the site is under review?
Retain the site's existing consent requirements and the provider's configured behavior. Use an authorized preview or test mode to check the permitted path before allowing live delivery.
Should I remove the ad plugin to remove one unit?
Disable the exact unit. First identify any other placements or site verification that depend on the plugin or shared code. Recheck the published or approved preview afterward before changing the integration itself.
Does installing the code mean the site has been approved?
Code installation and provider approval are separate stages. Check the account and domain status with the publisher provider. Use the approved internal or public preview to verify the technical insertion without assuming it can serve.
Keep a record of the placement and its owner
Record the supported insertion route, the one owner for shared code, the target unit and the consent checks that govern it. Use the same evidence when reviewing or removing the placement. For an eligible FroggyAds advertiser campaign, verify the destination's intended behavior before planning delivery.
Open a FroggyAds account for an eligible traffic test
The FroggyAds team prepared this publisher setup guide using first-party documentation and an illustrative WordPress change. Updated November 27, 2026.