Automatic Redirects When Changing the Post Slug

Did you know that All in One SEO can automatically create redirects when you change the slug for your content?

The slug is the part of the URL for your content that refers to that post or page.

For example, the URL for this article is https://aioseo.com/automatic-redirects-when-changing-the-post-slug/ which means the slug is:

automatic-redirects-when-changing-the-post-slug

WordPress automatically creates the slug when you draft a new post or page and add a title. You can change the slug at any time, but if you do it after you’ve published your content then it could break links to the post or page.

Having All in One SEO detect when a slug is changed is very useful because it means that you shouldn’t end up with broken links.

Below you can see the URL Slug field for the Hello world post in the Block editor:

When you change the slug for your post or page (or any other post types), All in One SEO will display a notice asking if you want to add a redirect.

Click the Add Redirect to Improve SEO button to open the Add a Redirect popup.

Add a Redirect popup in All in One SEO

The Source URL and Target URL fields will be prepopulated for you.

In the Redirect Type drop down, select the type of redirect you want. The two most common are:

  • 301 Moved Permanently: Use this if you want to permanently redirect the old URL because the URL has permanently changed.
  • 307 Temporary Redirect: Use this if you only want to temporarily redirect the old URL.
Redirect Type drop down in the Add New Redirection form

Click the Add Redirect button to add your redirect.

Clicking on the Advanced Settings link will display the Custom Rules setting. You can learn about using Custom Rules here.

Once a redirect has been added, you can edit it by going to Redirects in the All in One SEO menu.

That’s all! You’ve successfully added a redirect so that you don’t get broken links when you change the slug of your post or page.

Check out more documentation on our Redirection Manager here.

This feature was added in All in One SEO version 4.2.3. There's no legacy documentation available.