WordPress.org

Ready to get started?Download WordPress

Forums

404 Redirected
How to clear out all detected 404 links? (21 posts)

  1. wonder1and
    Member
    Posted 2 years ago #

    We just used a security scanner on our site to look for issues. It runs through a built in list it has for possible problem pages and trys them. I now have 56000 404s I need to clear out. I tried an uninstall/reinstall with delete and that did not work. Any ideas? Can I add a feature request to have a purge button added for detected 404s?

    Thanks in advance!

    http://wordpress.org/extend/plugins/404-redirected/

  2. Kelly
    Member
    Posted 2 years ago #

    Yes, same here, how to mass delete items?

  3. wonder1and
    Member
    Posted 2 years ago #

    This was what the dev sent to me. You have to run this directly against your DB. There is no front end to perform this task.

    delete from wp_wbz404_logs where redirect_id in (select id from wp_wbz404_redirects where status = 3);
    delete from wp_wbz404_redirects where status = 3;

    Changing the number 3 to the following is supposed to remove the other items:

    1=manual, 2=automatic, 3=captured, 4=ignored

  4. Daedalon
    Member
    Posted 2 years ago #

    I was wondering the same problem. I was hoping that the following plugin setting would automatically delete all that are older than the specified amount of days:

    Collected 404 URL deletion: [ ] Days (0 Disables Auto Delete)
    Automatically removes 404 URLs that have been captured if they haven't been used for the specified amount of time.

    Settings this to for example 7 did not delete any of the captured URLs from the months old history. What does this setting do instead?

    For running direct database commands I've heard high praise of Adminer.

  5. Daedalon
    Member
    Posted 2 years ago #

    There seems to be an UI for mass deleting them on the Captured URLs page, but only one page (25 items) at a time. There's no sorting by date though, which would allow for manually deleting for example the 1 000 oldest ones.

    The Logs page doesn't have any interface for deleting.

    It would be great to have an option to automatically delete all log information that is older than a specified amount of days. I would also recommend the default setting for this and all other auto removals to be less than 1095 days. Even two years (730 days) is likely more than nearly anyone would need.

  6. mikeotgaar
    Member
    Posted 2 years ago #

    Mass deletion of auto-redirects is one feature I would really like to see added to this plugin. DB editing is not for the average WordPress user...
    Also the time based deletion of auto redirects doesn't work

  7. jlangvad
    Member
    Posted 2 years ago #

    I'm having the same problem. With 33,755 automated redirects and counting I want to permanently delete the plugin and all the settings it might have made. How can I do that? Will all this data disappear if I remove and delete the plugin?

    Thanks,
    Jacob

  8. Daedalon
    Member
    Posted 2 years ago #

    If you don't have anything saved in the plugin settings that would be hard to replicate, we'd be glad to hear if uninstalling and reinstalling the plugin on wp-admin/plugins.php clears that list for you :)

  9. jlangvad
    Member
    Posted 2 years ago #

    I've tried to uninstall and re-install the plugin several times, but it does not flush the list. They are still there! Any advice on how to remove the log would be appreciated

  10. Daedalon
    Member
    Posted 2 years ago #

    I'd do it with Adminer, link is above. With that you either need a tiny bit of SQL database understanding or will develop it rapidly :) Remember to backup your database first.

    In a nutshell, the task is to identify the database table where this particular plugin stores the data, select the rows from that table that you don't want to keep and then to delete them. Or, if you removed the plugin otherwise completely already, to "drop" the plugin's table(s). "To drop" is SQL-talk for deleting a single table completely from the database.

  11. DaveOlsen
    Member
    Posted 2 years ago #

    Is there a way to automatically redirect the captured 404's to another page?

    I had a hack to one of my sites and Google now keeps looking for viagra pages that aren't there. I currently have almost 4,000 "Captured 404's" that need to be redirected. I started out doing this manually but it quickly became too overwhelming.

    Thanks in advance for any ideas.

    Dave

  12. Daedalon
    Member
    Posted 2 years ago #

    In that case I would erase the whole captured 404 list manually from the database using Adminer. Steps:

    1. Install, enable and open Adminer (the Tools menu in WP-Admin)
    2. Click "select" next to the table name "wp_wbz404_redirects" on the left hand side (or whatever your database table prefix is instead of 'wp').
    3. Change Limit from 30 to something bigger to show more redirections rows at once. On my site 500 worked fine.
    4. Below the dash-bordered box that says "SELECT * FROM wp_wbz404_redirects LIMIT 500", check the first [ ] edit checkbox to select all the 500 redirections rows, choose Export if you want to save them just in case, or if you already have a backup of your whole site handy, just Delete them. You can also try checking [ ] The whole result right below the table to Delete every row on that table at once.

    I just erased thousands of rows this way. It's a bugger to have to do this manually, and then also for the logs (for which there is an auto-cleaning option that doesn't work). I'll see if it doesn't take too much time to fix one or both of these things in the plugin. If it works, I'll post a patch in this thread.

  13. DaveOlsen
    Member
    Posted 2 years ago #

    Thanks Daedalon,

    That will get rid of the entries but I think they'll still come back once Google spiders them. I don't think it sent the 301 to google.

    Is there a way to update all of those entries to return a 301 on future spiders?

  14. Daedalon
    Member
    Posted 2 years ago #

    To clarify: you've never had any of the pages Google is looking for on your site? If that's the case, what exactly was the cause for Google to start looking for those pages?

    You can manually create redirections by editing your .htaccess file. For bulk operations like these when it's suitable to target all URLs with eg. "viagra" anywhere in them, .htaccess editing is the way to go. To return 301s and so forth, the thing to do is to search for the keywords such as "htaccess" "apache" and what you want to do, eg. "301" or "redirect" combined. That's assuming you're running on an Apache web server - Nginx and others have their own ways to do this.

  15. DaveOlsen
    Member
    Posted 2 years ago #

    The site was hacked so there are several thousand "viagra" (and other drugs) pages that were indexed. I've removed the hack so the pages don't exist any longer but Google had already indexed them so they are appearing as missing pages in my webmaster account.

    All of the pages end in .html (there are no other .html pages on the site) so I can use that in the .htaccess - I just wasn't able to figure out specifically how to do it (I'm not good with regular expressions and I couldn't find an exact fix in Google).

    I tried the link you supplied above, but wasn't able to get any of the examples working. The one below seems to be close (It changes all .html to .php):

    RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php

    I edited it to try to redirect everything to the home page but it returned an endless loop error in my browser.

    Any other ideas would be appreciated.

    Thanks in advance,

    Dave

  16. Daedalon
    Member
    Posted 2 years ago #

    Was that the exact line you tried, or did you change the last part (starting with http) to be an exact address to your website's home page? Eg. like this (don't remember if it makes a difference whether there's a / in the end or not):

    RedirectMatch 301 (.*)\.html$ http://www.example.com

    If you'd like to stick to 404 Redirected, you can let it create the redirection matches (if you deleted them, you can restore them from a database for a quick start) and then edit the database table to change where the redirection leads to.

  17. rrolfe
    Member
    Plugin Author

    Posted 1 year ago #

    Looks like we need a Tools tab in the admin section with some purge options. I will see if I can't add them for version 1.3.

    Thanks,
    Rob.

  18. Daedalon
    Member
    Posted 1 year ago #

    Good to hear from you, Rob.

    I'd say the issue is that the settings "Collected 404 URL deletion: [30] Days (0 Disables Auto Delete)" and "Auto redirect deletion: [30] Days (0 Disables Auto Delete)" don't work and a similar option to clear the logs is missing (unless it's the first option, in which case it deserves to be renamed for clarity). Fixing these would be excellent.

    Adding the following buttons in the Options tab would a nice addition:

    • Clear all automatic redirects
    • Clear all manual redirects
    • Clear all logs
    • Clear all redirects and logs
  19. Daedalon
    Member
    Posted 1 year ago #

    By the way version 1.2 of the plugin links to http://www.weberz.com/plugins/404-redirected/ as the plugin home page, and that page tells the newest version is 1.1.

    Thanks for your continued work on the development!

  20. rrolfe
    Member
    Plugin Author

    Posted 1 year ago #

    Ahh.. missed that one.. it's fixed now.. It says 1.3

  21. mikeotgaar
    Member
    Posted 1 year ago #

    @DaveOlsen
    Dave, you probably know this anyway - It's a bit time consuming, but you can request Google (Webmaster Tools) to remove those bad URLs from the index. I had to do this with a large batch of bad URLs

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic