Skip to main content
Cookbook Maintenance 404 to 301

Get a 404 Report by Email from 404 to 301 with AI

A daily, weekly or monthly email of new 404 errors and the most-hit missing addresses on your site.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running the free 404 to 301 plugin, 4.0.5 or newer (tested on 4.0.5), on WordPress 6.9 or newer, with an administrator account. Email from your site that arrives (an SMTP plugin helps).

The prompt
My site uses the 404 to 301 plugin. Email a [weekly] report of new 404 errors on my site to [your email address], with my yes first.

1. Run discover_abilities with category 404-to-301-settings. If it finds nothing, stop and tell me to install or update the free 404 to 301 plugin (4.0.5 or newer) on WordPress 6.9 or newer.
2. Run 404-to-301/settings-get and tell me email_reports_enabled, email_reports_frequency, email_reports_recipient and email_reports_attach_csv, and whether email_enabled is on (that one sends alert emails as 404s happen; leave it as it is). Never show me the Telegram bot token or chat id from the settings. If reports already go to my address at my frequency, tell me and stop.
3. Call my frequency FREQUENCY: daily, weekly or monthly. If email_reports_recipient already holds other addresses, ask me whether to keep them, and call the list to save, mine included, RECIPIENTS.
4. Tell me the change and wait for my yes: settings {"email_reports_enabled": true, "email_reports_frequency": "FREQUENCY", "email_reports_recipient": RECIPIENTS, "email_reports_attach_csv": false}. Say the attached spreadsheet is left off because it carries visitors' IP addresses and browsers to the mailbox, and that I can ask for it. Send only these keys, never any other setting.
5. On my yes, run 404-to-301/settings-update with that settings object and check the settings it returns show the change.
6. Run run_wp_cli cron event list and find d404_email_reports_tick: show me its next run (it is in UTC) and recurrence. If it isn't listed, list once more before telling me something is wrong. Tell me the first report comes at the next run shown above and then one each period, that after the first a period with no new 404s sends nothing, and that it goes out through my site's own email, so if my site's emails don't arrive, these won't either. To stop the reports, run 404-to-301/settings-update with settings {"email_reports_enabled": false}.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Get a 404 Report by Email from 404 to 301 with AI” recipe from the WPVibe cookbook on my connected site.

Broken links don’t announce themselves. A page gets renamed, a campaign link has a typo, another site links to an address that never existed, and the visitors quietly hit a missing page. 404 to 301 can email a report of new 404s, if you turn it on in its settings.

The AI reads your report settings, tells you what is on today, and after your yes turns on a daily, weekly or monthly report to the addresses you give. It changes only the report settings, and leaves out the attached spreadsheet by default, because that file carries your visitors’ IP addresses and browsers to the mailbox.

When it is first turned on, the first report is due about a minute later, then one each period; after the first, a period with no new 404s sends nothing. Reports go out through your site’s own email, so if your site’s emails don’t arrive, these won’t either. When a report shows addresses worth fixing, this recipe turns them into redirects.

Outcome

A 404 report goes to the addresses you chose on the schedule you chose, with its next run shown to you.