Skip to main content
Cookbook SEO 404 to 301

Stop 404 to 301 Sending Every Missing Page to the Homepage with AI

Find out where missing pages send your visitors, and replace the homepage catch-all with a proper not-found page.

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.

The prompt
My site uses the 404 to 301 plugin. Check what happens when someone visits an address on my site that doesn't exist, and if they are sent to the homepage, change it, with my yes first. I want [missing addresses to show my theme's normal not-found page, or to go to my page called ...].

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 note redirect_enabled, redirect_target, redirect_link, redirect_page and redirect_type exactly as they are. Never show me the Telegram bot token or chat id from the settings. Make up an address that can't exist, such as /wpvibe-check-qzx-not-a-page/, and call it TEST_PATH. Run 404-to-301/redirect-test with url TEST_PATH and tell me in plain words what a visitor gets: outcome fallback means they are sent to destination with status_code; outcome none means they see my theme's not-found page; outcome rule means one of my redirect rules catches it, so pick another made-up address.
3. If outcome is none, tell me nothing needs changing and stop. If the destination is not my homepage, tell me where it goes and ask whether to change it at all. Otherwise explain that a 301 tells browsers and search engines an address moved for good, so every dead link and typo on my site is reported as moved to my homepage, and visitors get no word that the page they wanted is gone. Say that my redirects for single addresses keep working and the 404 log keeps recording either way.
4. Unless I already said, ask which I want: A, turn it off, so missing addresses show my theme's not-found page (recommended); or B, send them to one published page I name, such as a sitemap or search page. For B, run rest_api GET /wp/v2/pages with search set to the page's title, use it only if its status is publish, and call its id PAGE_ID. Tell me B still sends visitors with the code in redirect_type (a 301 unless I changed it), so A is the cleaner fix.
5. Show me the exact change and wait for my yes. For A: settings {"redirect_enabled": false}. For B: settings {"redirect_target": "page", "redirect_page": PAGE_ID}. Send only those keys, as true or false and numbers, never as text. Never send redirect_type or any other setting: the plugin saves whatever it is given, and a wrong status code breaks every missing page.
6. On my yes, run 404-to-301/settings-update with that settings object and check the settings it returns show the change.
7. Run 404-to-301/redirect-test with TEST_PATH again and show me the result: outcome none for A, or fallback to the page's url for B. Ask me to open TEST_PATH on my site in a private window to see it. To undo it, run 404-to-301/settings-update with the values you noted in step 2 for the keys you changed.
Already connected?

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

Run the “Stop 404 to 301 Sending Every Missing Page to the Homepage with AI” recipe from the WPVibe cookbook on my connected site.

On a new install, 404 to 301 sends every address that doesn’t exist to your homepage with a 301, the code for moved permanently. A visitor who follows an old link lands on the homepage with no word that the page they wanted is gone, and every dead link and typo is reported as moved to your homepage.

The AI tests what a missing address does on your site today and tells you in plain words. If it goes to the homepage, it offers two fixes: show your theme’s normal not-found page, or send people to one page you choose, such as a sitemap or search page. It changes that one setting only after your yes, and tests again.

Redirects you made for single addresses keep working, and the 404 log keeps recording either way. To redirect the missing addresses that matter to the right page, use this recipe.

Outcome

Missing addresses show your theme's not-found page, or go to the one page you chose, tested before and after.