Site logo

Archived topic

Adsense Ads are not displayed in the website

28 replies · Started by Abdul on June 9, 2020

Viewing posts 16–29 of 29

There is still an adscript added to the <head> of your site.

Hi, I have not added any code anywhere or enabled any other plugin related to Ads.can you please let me know where to check so that I can look into it.
I did not edit the theme source or any other files.

Those scripts can be added in the following ways:

1. Plugins
2. GP Hook Element
3. Child theme functions.php
4. Code Snippets plugin
5. Google Tag Manager Container

You will need to check each of those options.

1. Plugins - No plugins related to Ads (Check the screenshot)
2. GP Hook Element - None (Check the screenshot)
3. Child theme functions.php - I did not do anything on this since I don't know where it is :)
4. Code Snippets plugin - None (Check the screenshot)
5. Google Tag Manager Container - I did not even register to this (check the screenshot)

Screenshots of current settings
https://imgur.com/a/xSilouO

Hi, Any updates on this one. can you please let me know so that I can fix it and move on to the next task. :)

Can you check the header.php file in "Appearance > Themes > Theme Editor"?

Perhaps it was added to the template itself.

Hi Tom

this is what I have in that file

<?php
/**
 * The template for displaying the header.
 *
 * @package GeneratePress
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<link rel="profile" href="https://gmpg.org/xfn/11">
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?> <?php generate_do_microdata( 'body' ); ?>>
	<?php
	/**
	 * wp_body_open hook.
	 *
	 * @since 2.3
	 */
	do_action( 'wp_body_open' );

	/**
	 * generate_before_header hook.
	 *
	 * @since 0.1
	 *
	 * @hooked generate_do_skip_to_content_link - 2
	 * @hooked generate_top_bar - 5
	 * @hooked generate_add_navigation_before_header - 5
	 */
	do_action( 'generate_before_header' );

	/**
	 * generate_header hook.
	 *
	 * @since 1.3.42
	 *
	 * @hooked generate_construct_header - 10
	 */
	do_action( 'generate_header' );

	/**
	 * generate_after_header hook.
	 *
	 * @since 0.1
	 *
	 * @hooked generate_featured_page_header - 10
	 */
	do_action( 'generate_after_header' );
	?>

	<div id="page" class="hfeed site grid-container container grid-parent">
		<?php
		/**
		 * generate_inside_site_container hook.
		 *
		 * @since 2.4
		 */
		do_action( 'generate_inside_site_container' );
		?>
		<div id="content" class="site-content">
			<?php
			/**
			 * generate_inside_container hook.
			 *
			 * @since 0.1
			 */
			do_action( 'generate_inside_container' );

checked on the google forums and found out that the Site Kit has added the code (I think this is the reason) I have now removed it. now it says the below

AdSense Code
The AdSense code has not been placed on your site

can you please check now and see if the code is removed and also guide me on how to add the Ads properly.

Please let me know if i can manually add the code now by adding a New Element.

will that work ?

Yes, it should work as long as you only have one block of Adsense code on the site. You can use Elements to do so :)

Hi, I added the code through element manually but I am not seeing any Ads on my website. can you please check and let me know how to fix it.

I can see the code is now correct on your site and there are no more errors.
Have you checked your adsense account and confirmed the code has been added?

Hi, Yes, I added the code using Elements and then enabled Auto Ads and getting 1 Ad on top of the homepage. I think it will take time to see Ads across the site. I will wait and see how it turns out. thanks for your help

You're welcome

This archived topic is closed to new replies.