admin管理员组

文章数量:1410697

The company I work for has an enterprise Wordpress site that was acquired from a different company. I don't know if there was a past hack or if it's just accumulated spam or what, but the wp_redirection_404 table has grown to roughly 7GB.

I tried grepping the table for Viagra, Versace, Nike, etc. and got pages of results for each. It's obviously full of junk.

It doesn't appear to be doing anything. In fact, when downloading it locally to work on, I don't even bring that table, and I don't notice anything at all. Also, I do a procedure where I must download from a production site sync back into a staging site. Just the process of downloading and uploading usually takes 1.5 hours. By contrast - on another huge Wordpress site, syncing the database usually takes about 45 seconds.

Do I need this table for anything? Can I just empty it? Any sort of complicated scripting to filter legit values just seems too time consuming at this point, as even loading the sql to look at it can take a couple of minutes. Basically - is there anything in this table that I can't do without?

I'm not looking for anecdotal answers, but someone who really knows or at least has had experience with this exact situation.

Thanks

The company I work for has an enterprise Wordpress site that was acquired from a different company. I don't know if there was a past hack or if it's just accumulated spam or what, but the wp_redirection_404 table has grown to roughly 7GB.

I tried grepping the table for Viagra, Versace, Nike, etc. and got pages of results for each. It's obviously full of junk.

It doesn't appear to be doing anything. In fact, when downloading it locally to work on, I don't even bring that table, and I don't notice anything at all. Also, I do a procedure where I must download from a production site sync back into a staging site. Just the process of downloading and uploading usually takes 1.5 hours. By contrast - on another huge Wordpress site, syncing the database usually takes about 45 seconds.

Do I need this table for anything? Can I just empty it? Any sort of complicated scripting to filter legit values just seems too time consuming at this point, as even loading the sql to look at it can take a couple of minutes. Basically - is there anything in this table that I can't do without?

I'm not looking for anecdotal answers, but someone who really knows or at least has had experience with this exact situation.

Thanks

Share Improve this question asked Mar 23, 2018 at 16:47 dgodgo 1251 silver badge6 bronze badges 2
  • 1 There's a plugin named WP-Sweep. It will probably help you clean it up. But first, make sure to do a back up! – Johansson Commented Mar 23, 2018 at 16:50
  • You should contact plugin support at wordpress/support/plugin/redirection that table isn't a part of WordPress but a 3rd party plugin – Tom J Nowell Commented Mar 23, 2018 at 17:04
Add a comment  | 

2 Answers 2

Reset to default 6

That table is from the redirection plugin, and isn't a part of WordPress Core. Deleting it should have no ill effects as long as you disable the plugin too.

If you wish to continue using that plugin though, I recommend using the plugin authors support at https://wordpress/support/plugin/redirection/

This is a LOG table. It logs 404 errors - requests that Redirection could not resolve. The proper way to shrink the table is: change the setting "time to keep logs for" to something shorter than "Forever". Navigate to WP Dashboard / Tools / Redirection / Options / 404 Logs. Choose one of:

No logs
A day
A week
A month
Two months

The next time Redirection gets around to performing its log maintenance, the old records will be deleted from this table. Maybe visit a URL that Redirection has on file to trigger that. Or, just trim the log with SQL:

Select          Now()                    As TodayNow   ;
Select Date_Sub(Now(), Interval 1 Month) As OneMonthAgo;
Select Count(*) As OldRecords From Redirection_404 Where Created < Date_Sub(Now(),Interval 1 Month);
Select       *                From Redirection_404 Where Created < Date_Sub(Now(),Interval 1 Month);
Delete                        From Redirection_404 Where Created < Date_Sub(Now(),Interval 1 Month);

本文标签: databasewpredirection404 table has grown to 7GB