WordPress.org

Ready to get started?Download WordPress

Forums

PLEASE HELP! I can't remove google ads (25 posts)

  1. theloveco-mission
    Member
    Posted 1 year ago #

    I can't figure out how to remove google ads from my website without trashing the whole layout of the page. I inserted the code elements a while back and can't remember what to remove and what to leave.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    can you link your website & do you know which page you inserted it into?

  3. theloveco-mission
    Member
    Posted 1 year ago #

    thelovecomission.com I've got it on all the pages like a dumbass of course. I can post the code if I need to.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Please post the code as well, especially the code that's generating the advert

  5. theloveco-mission
    Member
    Posted 1 year ago #

    This is the code from the Main Index Template. I inserted the same googleads code into the Page Template and the Single Post as well.

    [please mark any posted code - see http://codex.wordpress.org/Forum_Welcome#Posting_Code - or even better, use the http://pastebin.com/ ]

    <?php
    /* Theme: Lagom by andreasviklund.com - Based on Toolbox by Automattic */
    get_header(); ?>
    
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php /* Display navigation to next/previous pages when applicable */ ?>
    				<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    					<nav id="nav-above">
    						<h1 class="section-heading"><?php _e( 'Post navigation', 'lagom' ); ?></h1>
    						<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'lagom' ) ); ?></div>
    						<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'lagom' ) ); ?></div>
    					</nav><!-- #nav-above -->
    				<?php endif; ?>
    
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', get_post_format() ); ?>
    
    				<?php endwhile; ?>
    
    				<?php /* Display navigation to next/previous pages when applicable */ ?>
    				<?php if (  $wp_query->max_num_pages > 1 ) : ?>
    					<nav id="nav-below">
    						<h1 class="section-heading"><?php _e( 'Post navigation', 'lagom' ); ?></h1>
    						<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'lagom' ) ); ?></div>
    						<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'lagom' ) ); ?></div>
    					</nav><!-- #nav-below -->
    				<?php endif; ?>				
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-6629725798987586";
    /* Like us on Facebook */
    google_ad_slot = "6541553565";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script><?php get_footer(); ?>
  6. kmessinger
    Volunteer Moderator
    Posted 1 year ago #

    Check your widgets. You have the Google script running in the #tertiary .widget-area

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    What's in footer.php?

  8. theloveco-mission
    Member
    Posted 1 year ago #

    Here's the footer code. Going to check the widgets now also.

    [please mark any posted code - see http://codex.wordpress.org/Forum_Welcome#Posting_Code - or even better, use the http://pastebin.com/ ]

    <?php
    /* Theme: Lagom by andreasviklund.com - Based on Toolbox by Automattic */
    ?>
    
    	</div><!-- #main -->
    
    	<footer id="colophon" role="contentinfo">
    			<div id="site-generator">
    				<a href="http://wordpress.org/" rel="generator"><?php _e( 'Powered by', 'lagom' ); ?> WordPress</a><span class="sep"> | </span><?php _e( 'Theme: Lagom by', 'lagom' ); ?> <a href="http://andreasviklund.com/">Andreas Viklund</a>
    			</div>
    	</footer><!-- #colophon -->
    </div><!-- #page -->
    
    <?php wp_footer(); ?>
    
    </body>
    </html>
  9. kmessinger
    Volunteer Moderator
    Posted 1 year ago #

  10. theloveco-mission
    Member
    Posted 1 year ago #

    pastebin! I was trying to remember what that site was. So I looked in the widgets menu area and I don't see anything about google. I apologize for my ignorance guys.

  11. nickaster
    Member
    Posted 1 year ago #

    Two options - either look in "widgets" - there may be some google ad widget in there you can deactivate.

    Or simply edit the main index template and get rid of this:

    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-6629725798987586";
    /* Like us on Facebook */
    google_ad_slot = "6541553565";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
  12. Andrew
    Forum Moderator
    Posted 1 year ago #

    I guess you'll just have to go through each page and remove this

    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
  13. theloveco-mission
    Member
    Posted 1 year ago #

    http://thelovecomission.com/tweet-journal/

    Ok this is what it always does to me. I deleted the code recommended by nickaster. It only effected the main blog page of the site. No other pages changed - googleads still remains. But it has totally changed the format of the page now. You can see what I am talking about at the link above compared to the other pages on my site. I can repost the code as it sits now if needed.

  14. theloveco-mission
    Member
    Posted 1 year ago #

    anevins I also tried your suggestion and it did the same thing. Googleads gone but page format or theme format or whatever all messed up.

  15. Andrew
    Forum Moderator
    Posted 1 year ago #

    Or

    You could display:none (CSS) on #ads (or whatever element is containing it)

  16. theloveco-mission
    Member
    Posted 1 year ago #

    Come again?? You mean reinsert the code that was there but change one piece of it to say "none"???? Again I apologize for my inexperience. Thanks for your help!!

  17. Andrew
    Forum Moderator
    Posted 1 year ago #

  18. theloveco-mission
    Member
    Posted 1 year ago #

    I'm not having any luck. This is how I have tried inserting the code...

    [please mark any posted code - see http://codex.wordpress.org/Forum_Welcome#Posting_Code - or even better, use the http://pastebin.com/ ]

    <?php get_sidebar(); ?>
    <style type="text/css">
    h1.hidden {display:none;}
    </style>
    <script type="text/javascript"><!--
    google_ad_client = "ca-pub-6629725798987586";
    /* Like us on Facebook */
    google_ad_slot = "6541553565";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <style type="text/css">
    h1.hidden {display:none;}
    </style>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <?php get_footer(); ?>
  19. Andrew
    Forum Moderator
    Posted 1 year ago #

    <style type="text/css">
    h1.hidden {display:none;}
    </style>

    Will need to be in the <head> section and should be

    <style type="text/css">
    #ads {display:none;}
    </style>

    I think the wrapping HTML element had an id of ads, check what it is.

  20. theloveco-mission
    Member
    Posted 1 year ago #

    So do I go then to the Header template and insert the first code at the top of the <head> section and the other at the bottom of it?

  21. Andrew
    Forum Moderator
    Posted 1 year ago #

    Just the one in the header template
    This

    <style type="text/css">
    #ads {display:none;}
    </style>
  22. theloveco-mission
    Member
    Posted 1 year ago #

    I've tried putting that code in at the top of the section and at the bottom and there is no change in the page or in the googleads.

  23. Andrew
    Forum Moderator
    Posted 1 year ago #

    Add

    <style type="text/css">
    #ads {display:none !important;}
    </style>
  24. theloveco-mission
    Member
    Posted 1 year ago #

    This is insane bro! I can't even turn the ads off in my googleadsense account! There's no good help from google either. Any more ideas?? I need to get rid of these ads from my site. They are ruining its image now.

  25. theloveco-mission
    Member
    Posted 1 year ago #

    I got it. I blocked all categories of ads. Created a new ad the same size as the previous in text only and set everything to the same color including the blank ad space. Pasted that code into the space of the old code and I have nothing but a clean white space at the bottom of the pages....for now. Hopefully google doesn't figure it out and somehow get me back!!

    Anyway that's how I overcame googleadsense on my site if you ever encounter this again. 2 months of trying and this is all I could make work. Thanks for your help guys!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.