Support » Fixing WordPress » PLEASE HELP! I can't remove google ads

  • 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.

Viewing 15 replies - 1 through 15 (of 24 total)
  • Moderator Andrew Nevins

    (@anevins)

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

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

    Moderator Andrew Nevins

    (@anevins)

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

    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(); ?>
    Moderator kmessinger

    (@kmessinger)

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

    Moderator Andrew Nevins

    (@anevins)

    What’s in footer.php?

    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>
    Moderator kmessinger

    (@kmessinger)

    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.

    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>
    Moderator Andrew Nevins

    (@anevins)

    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>

    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.

    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.

    Moderator Andrew Nevins

    (@anevins)

    Or

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

    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!!

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘PLEASE HELP! I can't remove google ads’ is closed to new replies.