This article is also available in:

How to add an Ad Tag to <head> section in WordPress

Paste your EZmob code into the <head> section of your WordPress site using a plugin, a child theme or the wp_head hook. Note: wordpress.com addresses can't be validated. Only a site on a custom domain can be validated and receive premium demand.


Copy your ad code


  1. In the EZmob dashboard, open Sites & Placements → Your Placements.
  2. Click the code icon (View Script) on the placement.
  3. Click Copy Script.


Option 1: Use a plugin (easiest)


  1. Install any plugin that inserts code into the site header.
  2. Paste the code into the plugin's header (<head>) field for all pages.
  3. Save.


Option 2: Edit a child theme


  1. Open your child theme's header.php. Don't edit the parent theme, or updates will remove your change.
  2. Paste the code just above </head>.
  3. Save the file.


Option 3: Use the wp_head hook


Add this to the end of your theme's functions.php, replacing the comment with your code:


function ezmob_insert_header() {
    ?>
    <!-- Paste your EZmob code here -->
    <?php
}
add_action( 'wp_head', 'ezmob_insert_header' );


Use any of these options to add your site's Validation Code too, then click Validate in EZmob.


Header Bidding banner


The Header Bidding code ends with <div id="container1"></div>, which marks where the banner shows.


  1. Add the code without that <div> to <head>, as described above.
  2. In WordPress, go to Appearance → Widgets.
  3. Add a Custom HTML widget to your sidebar, paste <div id="container1"></div> and save.


Screenshots


Sites & Placements → Your Placements, banner script view with Copy Script highlighted


  • Screenshot: WordPress Appearance → Widgets, Custom HTML widget with the container div



Updated on: 01/10/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!