SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: WordPress fubar

  1. #1
    SitePoint Member ThatGuy's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy WordPress fubar

    What happened...

    So.. I had a adsense account suspended.. In panic i started deleting posts, tags and doing expanded searches for any clothing sizes "xxxl" or any other terms that could be offensive...

    I resubmitted for reactivation and was denied. So i deleted more product pages, tags and such that are valid product names but apparently are sex related slang. Such as the shoe brand "Footjoy" which from my understanding is slang among some for some sort of perversion.

    Then there was a HUGE influx of other people posting similar problems and reporting being suspended unsure of what they have done wrong.

    Ended up the site had been hacked by what is referred to as a conditional hack. Basically the text and link was not viewable by a browser but when visited by a google bot the link to the porn sites was inserted. For me it was in the copyright statement and the function calling "year" was swapped out with a long line of porn links.

    So i removed the function from the footer in wordpress and adsense has been restored... Unfortunately even after cleaning up i was looking at over 2500+ broken links.

    I have been doing what i can cleaning up all wordpress sites affected but my ranking will never be what it was.. I still have dead links listed online that are no longer dead but for some reason they still show in the Google webmaster tools report. I tried to used a plugin absolute links but it only ended up in creating redirect loops.

    From experienced users that have had this type of situation with thousands of broken links at one time..

    Is it better to just redirect all 404 errors to the index page that cant be restored?

    Is there any standard procedure for a situation like this to help recover link juice or is all lost?

    Any and all suggestions are welcome..

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2008
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    404 errors should not be redirected to the index page, ever. Just leave them as 404. You can put a link to the index page on your 404 page, but don't do the redirect by any automatic method.

    If any of the pages that are now returning 404 have offensive names (that is, pages inserted by the hack that weren't your originally named pages), you can use .htaccess to return a 410 Gone response for them instead of 404. The 410 tells search engines to deindex the page immediately and not come looking for it again.

    Sorry I don't have a solution for 2500 broken links, unless you have a backup of your site and its database from before the hack.

  3. #3
    SitePoint Member ThatGuy's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the last backup i had was infected...

  4. #4
    SitePoint Member ThatGuy's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SteveWh View Post
    404 errors should not be redirected to the index page, ever. Just leave them as 404. You can put a link to the index page on your 404 page, but don't do the redirect by any automatic method.

    If any of the pages that are now returning 404 have offensive names (that is, pages inserted by the hack that weren't your originally named pages), you can use .htaccess to return a 410 Gone response for them instead of 404. The 410 tells search engines to deindex the page immediately and not come looking for it again.

    Sorry I don't have a solution for 2500 broken links, unless you have a backup of your site and its database from before the hack.
    So in wordpress what is the best way to setup about 1,100 410 status?

    I just keep finding wordpress plugins that do a 301 redirect to the site root.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2008
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ThatGuy View Post
    So in wordpress what is the best way to setup about 1,100 410 status?
    If you can identify the bad requests because there are offensive words in the URLs or the querystrings, you can put code in your top level .htaccess that will report the URLs as Gone even before the request reaches WordPress.

    Here is some template code for doing that, but you must NOT just drop this code into your .htaccess. You will need to understand exactly what it does and customize it for your purposes. This is just an example. If any of the bad words appears in the base URL or in the query string, the associated page will get a 410 response.

    If you can't identify the requests by there being offensive words in the URI or query string, this code won't help at all.

    Example of bad word in URI:

    hxxp://yoursite.com/buy-cheap-badword-online.html

    Example of bad word in query string:

    hxxp://yoursite.com/index.php?topic=badword

    The list of words for the URI and query string don't have to be the same.

    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} (badword1|badword2|badword3) [NC,OR]
    RewriteCond %{QUERY_STRING} (badword1|badword2|badword3) [NC]
    RewriteRule .* - [G,L]
    I just keep finding wordpress plugins that do a 301 redirect to the site root.
    I haven't used WordPress. I think some applications redirect 404's to the site root by default. Don't know if that's true of WP. If it is, there may not be much you can do about it unless you dig into the code or try to modify WP's default .htaccess, which would carry the risk that you might mess things up.

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2008
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On the broken link problem, were those created by your tearing out products, etc., before you knew what the problem was?

    If so, you could start with your infected backup copy, and this time just clean the parts that actually need it. Yes, you'd be doing the cleanup a second time, but this time you could do a better job of it, without all the unnecesary damage.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •