Skip to content Skip to navigation

Enable 301 redirections and 404 monitoring

Create a global redirect

To do that, go to SEO, PRO, Redirections / 404 tab.

Check the iOS radio button associated with Redirections.

Refresh your page, a new custom post type called Redirections is now available on your left menu.

Click Add redirection under Redirections custom post type.

Add your url in title field (eg: “my-custom-permalink”) without your domain name neither slash before or after.

If you have a permalink structure like /%category%/%postname%/, make sure to include the categories: “category/sub-category/my-custom-permalink”.

From the SEO metabox:

  • check Enable redirection,
  • choose a redirection type,
  • select a login status,
  • and set a new url (must be in absolute, eg: “https://example.com/test”).

Click Publish.

Create a redirect with SEOPress
Create a redirect with SEOPress

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

To use a regular expression in the origin URL, make sure to check “Regex” option from the SEO metabox, Redirection tab (see screenshot).

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/.

Regex option in Redirections - SEOPress PRO
Regex option in Redirections – SEOPress PRO
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, (.*)

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, make sure the option “Disable notifications on slug changes or post / term deletions” is not unchecked from SEO, PRO, Redirections / 404 tab.

Then, edit a permalink, save your post and go back to the post type list to see the notice.

Click the Create a redirection button, check all the pre-filled fields and click Publish.

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

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.

Do not forget to Save changes.

My redirect doesn’t work!

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.

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