Skip to content Skip to navigation

Enable 301 redirections and 404 monitoring

Create a global redirect

Go to SEO → PRO → Redirections / 404, enable Redirections and save. Open SEO → Redirections and click Add redirection.

In Origin URL, enter a relative path without the domain or an anchor, for example my-custom-permalink. Include the categories if they are part of the permalink, for example category/sub-category/my-custom-permalink.

Choose the redirection type, enter the absolute destination URL (for example https://example.com/test) and leave the rule enabled. Set any login condition under Advanced options → Apply to.

Click Create redirection for a new rule, or Save redirection when editing one. After saving, use Test URL in the editor or redirection list to check the rule.

Create a redirect from an existing post

If you want to redirect a post, page or post type, you can do that directly from post screen editing via our SEO metabox, Redirection tab.

Enter your redirect URL in absolute, check Enable Redirection and choose 301 as a type.

Save your post and clear your cache if necessary.

Advanced settings for redirects

Regular expressions

In the redirection editor, turn on Enable regex matching and enter your pattern in Origin URL. Patterns are matched against the full path, including its leading slash.

Enter your regex in the origin URL field (ie post title).

We strongly suggest you to use Regex online tester to help you like https://regex101.com/.

Since version 5.5 of SEOPress PRO, you can capture groups and pass them dynamically to the destination URL.

For example, you want to redirect all your product pages like:

https://example.com/product/my-singular-product-page

https://example.com/product/another-singular-product-page

To a new permastructure like:

https://example.com/shop/my-singular-product-page

https://example.com/shop/another-singular-product-page

Simply enter this a source URL:

^/product/(.*)

And in the URL redirection field:

https://example.com/shop/$1

$1 matches the first captured group in your regex, ie, (.*)

Query parameters

Query parameters in a redirect refer to the additional information appended to a URL, typically after a question mark (?). They are used to pass data to the server, which can then be used to determine how to handle the request.

Query parameters can be managed in different ways:

  • Exactly match all parameters: The redirect will only occur if the query parameters in the request match exactly with those specified in the redirect rule.
  • Exclude all parameters: The redirect will occur without considering any query parameters, effectively ignoring them.
  • Exclude all parameters and pass them to the redirection: The redirect will occur, and the query parameters will be passed along to the destination URL.

These options allow you to control how query parameters are handled during the redirection process, ensuring that the desired behavior is achieved.

Connection status as a condition

If you want to run a redirect based on the connection status of your visitor, click on “Select a login status” list and choose between 3 options:

  • Only Logged In
  • Only Not Logged In
  • All (default)

For example, you have a ecommerce site and you want to redirect your clients only if they are logged in to their account, now you can!

Custom conditions for redirects

If you need advanced custom conditions, we have a hook for that!

seopress_before_redirect

The argument passed is a WP_Post object, you can pretty much do everything you want now by adding your own conditions.

Automatic redirects on post deletion / slug change

SEOPress can automatically alert you via a notice as soon as a URL is modified or deleted in order to create a redirection from the old URL to the new one in 2 clicks.

First, leave Disable notifications on slug changes or post / term deletions unchecked in SEO → PRO → Redirections / 404.

Then edit a permalink, save the post and return to the post list to see the notice. Click Create a redirection, review the prefilled fields and click Create redirection.

Notice on slug change to create a redirect with SEOPress PRO
Notice on slug change to create a redirect with SEOPress PRO

Import / Export redirects

Please follow this guide to import / export your redirects from a CSV file to SEOPress.

Enable 404 monitoring

If you want to monitor all your 404 errors, go to SEO, Pro, Redirections / 404 and check Enable 404 monitoring.

We also strongly recommend you to enable the 404 cleaning by checking Automatically delete 404 after 30 days (useful if you have a lot of 404) option.

You can exclude paths from 404 monitoring by adding them to the dedicated field Exclude paths from 404 logging.

Do not forget to Save changes.

My redirect doesn’t work!

URL conflicts

Try to clear your 404 errors from SEO, Tools, Redirections tab, Clean your 404 section, and click Delete all 404 button.

Try also to clear your browser cache.

And make sure the checkbox Enable redirection is checked.

Check also your Redirects list to make sure you don’t have a duplicated origin URL, or a regular expression similar to another one.

Query parameters

Depending on how your website is built, dynamic query parameters may be used in URLs. This setting should then be adjusted from the redirect creation, query parameters.

If it still doesn’t work, please open a support ticket.