Forums

wp-blog-header.php is a google ad (15 posts)

  1. dosbeerigos
    Member
    Posted 2 years ago #

    This morning I added google ads to my RSS links and this afternoon when I went to my login page Dosbeerigos.com/wp-admin the only thing that pulls up is a google ad?

    I did some searching and the wp-blog-header.php is pulling up on a preview of the ad.

    The code inside the file is reading;

    <?php
    /**
    * Loads the WordPress environment and template.
    *
    * @package WordPress
    */

    if ( !isset($wp_did_header) ) {

    $wp_did_header = true;

    require_once( dirname(__FILE__) . '/wp-load.php' );

    wp();

    require_once( ABSPATH . WPINC . '/template-loader.php' );

    }

    ?>

    I am not sure why this is happening, is there anyway to fix this without losing all my information on my website? I can't even get into the dashboard to attempt to delete google adsense.

    Thank you in advance!

  2. blondishnet
    Member
    Posted 2 years ago #

    Is this a plugin you inserted, or did you put this in a file outside your theme's header.php template?

  3. dosbeerigos
    Member
    Posted 2 years ago #

    It was not a plugin, I attempted to place an ad in my footer this morning, but deleted it immediately after since it didnt show up on the site

  4. blondishnet
    Member
    Posted 2 years ago #

    Most people I know put the google ads into their post or page template where it shows up right above each post and page entry.

    I would go into the template and remove the code. Should fix the problem. That is very strange that it showed up in your login page.

    You really only need to alter the pages in your wp-content/themes/yourtheme
    and no other place.

  5. dosbeerigos
    Member
    Posted 2 years ago #

    "I would go into the template and remove the code. Should fix the problem. That is very strange that it showed up in your login page."

    which template? I only have access to my ftp server is the issue in wp-content/themes/yourtheme ?

  6. blondishnet
    Member
    Posted 2 years ago #

    If there is a way to access that file... then that is where you need to go and remove the code producing the Google ad code where you do not want it to go.

    There should be no reason why that code should show in your wp-admin page at all unless you put it there.

    So, you have to remove that code and put it in another place.

  7. dosbeerigos
    Member
    Posted 2 years ago #

    Thats the thing I cant find the file with the google ad code in it....is the code in my wp-blog-header.php file correct

  8. dosbeerigos
    Member
    Posted 2 years ago #

    or is there a way to reinstall the theme to clear out wherever the code went without losing all of my content?

    or a way to backup the site content and doing a fresh install?

  9. blondishnet
    Member
    Posted 2 years ago #

    if you have that file in your theme's folder, then yes.

    Otherwise, go through each file carefully just in case to check.

    So... you do not have access to anything outside your theme's folder in FTP or on your webhosting account?

  10. dosbeerigos
    Member
    Posted 2 years ago #

    no I have access to everything through my ftp client (filezilla) just no access to dashboard for wordpress

  11. blondishnet
    Member
    Posted 2 years ago #

    You may have to look at whatever files you edited before. It just seems you edited a file you may have accidentally added the google ad code to and meant to put it elsewhere. I cannot tell because I have no access to that to be able to tell you exactly what is going on.

  12. dosbeerigos
    Member
    Posted 2 years ago #

    I just went through the php files in the main folder, nothing

    and the files under wp-admin nothing

    any idea where I should look or a way to search the script on the site to see the root folder for the file?

  13. blondishnet
    Member
    Posted 2 years ago #

    You might have to check all of your files. I am not sure where else to tell you to look. I would offer to solve this issue, but I have no time to do free site work.

    It has to be somewhere. I would probably recommend replacing most of your files except your wp-content folder and your wp-config.php to fix the issue....and see if the problem was that a file outside your theme was edited.

  14. dosbeerigos
    Member
    Posted 2 years ago #

    Thank you for your help blondishnet

    I found the file

    Is there a way that I can ad the google ads automatically at the end of each of my posts?

  15. blondishnet
    Member
    Posted 2 years ago #

    You can ad it in your single.php file of your theme

Topic Closed

This topic has been closed to new replies.

About this Topic