How do I use regular expression redirects in Yoast SEO Premium?

The Citead team, updated

In short. Create a rule under Yoast SEO > Redirects > Regex Redirects, with a source pattern and a destination that can reuse captured text.

Definition: As of 17 October 2026, a regular expression (regex) redirect in Yoast SEO Premium uses a text pattern to match multiple source URLs and send them to a destination URL.

Key facts

  • Yoast's redirect manager overview describes regex rules for groups of URLs sharing a word or pattern.
  • The regex help article places these rules under Yoast SEO > Redirects > Regex Redirects and documents support for capturing groups, which are parenthesized parts of a pattern.
  • Yoast's import documentation shows regex origins paired with destination substitutions such as /$2, and recommends relative destination URLs for links within the same site.

Where is a regex redirect created?

The regex setup instructions begin in the WordPress Dashboard. The route is Yoast SEO > Redirects > Regex Redirects. After the rule fields are filled in, Add Redirect saves the rule.

Yoast's general redirect instructions explain the Redirect Type selector and the New URL destination field. The documented types include 301 Moved Permanently, 302 Found and 307 Temporary Redirect. The destination can point to an external site. Source input is relative to the WordPress installation's site address.

How does the pattern select URLs?

Yoast's regex explanation illustrates a broad match with rain: the examples include /rain, /in-the-rain and /draining. Matching text can therefore occur inside a longer path.

The same article describes a holiday-path rule that matches /rainy-holidays/london/ and excludes /rainy-holidays/buda+pest/. Yoast recommends regex redirects for users with redirect experience because an incorrect rule can break the website.

How does captured text reach the destination?

Yoast's CSV import guide provides this example with its required header:

Origin,Target,Type,Format
"^/([0-9]{2})/(.+)$","/$2",307,"regex"

In this example, the origin captures two digits after a leading slash, then the text after the next slash. The target /$2 reuses the second captured group after a leading slash. The ^ and $ delimit the beginning and end of the match. The row selects type 307 and marks the format as lowercase regex.

The same guide recommends origins beginning with /, absolute targets for other sites, and relative targets beginning with / for the current site. For 410 and 451 entries, the target cell must be empty.

FAQ

Can I send matching URLs to another website?

Yes. Yoast's redirect instructions allow an external destination in New URL. The source addresses handled by the plugin remain tied to the WordPress installation's site address.

Can I update an existing regex redirect by importing it again?

Yoast's import guide says existing redirects are skipped during import. You can update them in the redirect manager.

What should I check if a saved redirect appears unchanged?

The redirect instructions recommend clearing caches when redirects fail, including the theme, plugin, server, CDN and browser caches.

Sources

  1. Yoast, "Redirect Manager", updated 18 August 2026
  2. Yoast, "What are Regex redirects?", updated 24 February 2026
  3. Yoast, "How to redirect a post or page in Yoast SEO Premium", updated 18 February 2026
  4. Yoast, "How to import redirects using Yoast SEO Premium", updated 12 May 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark