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.
-
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.
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 https://codex.www.ads-software.com/Forum_Welcome#Posting_Code – or even better, use the https://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="https://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><?php get_footer(); ?>
Check your widgets. You have the Google script running in the #tertiary .widget-area
What’s in footer.php?
Here’s the footer code. Going to check the widgets now also.
[please mark any posted code – see https://codex.www.ads-software.com/Forum_Welcome#Posting_Code – or even better, use the https://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="https://www.ads-software.com/" rel="generator"><?php _e( 'Powered by', 'lagom' ); ?> WordPress</a><span class="sep"> | </span><?php _e( 'Theme: Lagom by', 'lagom' ); ?> <a href="https://andreasviklund.com/">Andreas Viklund</a> </div> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
Normally post large amounts of code in https://www.pastebin.com
https://codex.www.ads-software.com/Forum_Welcome#Posting_Codepastebin! 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="https://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
I guess you’ll just have to go through each page and remove this
<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
https://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.
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!!
- The topic ‘PLEASE HELP! I can't remove google ads’ is closed to new replies.