Fixing of WordPress Old URL Redirecting to New URL when a WordPress post’s slug changes can follow the below steps.
1. Does WordPress automatically 301 redirects if you change a post URL slug?
WordPress will do 301 redirects for the post’s URL or Slug change. Changing a post’s slug in WordPress will automatically create 301 redirects from the old URL to the new URL. WordPress Old URL Redirecting to New URL has been doing for default post type called post.
Google loves short URLs. SEO specialist changes long URLs to shot URLs for SEO purpose. If you built backlinks by using old URL the URLs are broken it is already indexed in search engines it will cause 404 error and when we change the old URL will show 404 error this why WordPress does automatically 301 redirects old URLs to new URLs this why WordPress is SEO friendly.
WordPress has this suitable feature of recollecting the old URL and 301 redirecting to the new URL so that your links aren’t broken, and backlinks are work fine due to this feature.
This is a cool and trendy feature in WordPress, but it can cause frustration because there are no options in the WordPress dashboard. The only way to remove these old entries is from your WordPress database directly.
2. Why is it important to redirect URLs for SEO?
The role of the 301 redirect in SEO is to preserve your build up rankings and passes of the page authority from an old URL to a new URL. 301 redirections will pass as much value from the old URLs to the new URLs as possible.
If you don’t do 301 redirections may be seen as a soft 404 error page, and search engines won’t pass the authority and traffic-related over from the old URL.
3. Where to implement the redirections?
301 redirections is a developer’s task, ask your developers to do it. In WordPress, we can do through plugins and in server config files like a .htaccess file. Avoid chained redirections; it will cause frustration to users as well as bots. In this situation, your browser will do chained redirections; we can observe the page will not be open; it does redirections continuously.
How To Fix or Turn off or remove WordPress Automatic Old URL Redirecting to New URL when a post’s URL or slug changes?
I don’t recommend changing URL slug before writing a blog we should take care of proper URL slug for posts or pages.
First I had been created a post and published, after few days I was changed my post slug URL that time I have observed when I am updating my new slug it is working fine after being open my old post URL into the browser it is an automatic redirect to my original post URL.
I search on WordPress Codex i found an function called (‘wp_check_for_changed_slugs()’) and its post meta field (‘_wp_old_slug’).
The post meta field (‘_wp_old_slug’) save old slug when changed slugs for published posts.
WordPress has a great feature of remembering the old URL slugs and stored into the database. WordPress Core default added post meta field (‘_wp_old_slug’) for storing old URL slugs for that post.
The most logical use of this function is redirecting changed posts so that those that linked to a modified post will be redirected to the new post.
[php]<?php wp_check_for_changed_slugs( $post_id ); ?>[/php]
The above function returns the changed post slugs. $post_id means Post ID.
It is used to check the changed post slugs for published posts.
The below steps we can follow to fix or Turn off or remove WordPress Automatic Old URL Redirecting to New URL when a post’s URL or slug changes.
This option is not available on WordPress dashboard we need to perform this on WordPress database.
Follow the below steps on how we can fix or Turn off or remove WordPress Automatic Old URL Redirecting to New URL when a post’s URL or slug changes.
Before doing this process, First, take a backup of your WordPress database file first.
4. Steps to remove or fix WordPress Automatic Old URL Redirecting to New URL.
1. Login to your Cpanel and open database via phpMyAdmin.
2. In phpMyAdmin click on your WordPress database file.
PhpMyAdmin is a most popular and powerful web-based user interface for administering MySQL or MariaDB databases. It is open source web tool, written in Hypertext Preprocessor (PHP). It is one of the better web tools available for working with MySQL or MariaDB databases. It is used to handle the MySQL CRUD operations easily.
MySQL is one of the most popular open source SQL (Structured Query Language) database implementation. WordPress requires a MySQL Database to store all blog related information, including posts, comments, metadata, custom fields, and other information.
3. Click the search tab on phpMyAdmin menu bar.
4. Search a post meta field value called _wp_old_slug and select all inside tables and then hit the go button.
5. It will show the search criteria for _wp_old_slug value matches.
6. We can observe 19 matches in the post meta table in the above screenshot with browse and delete options. Click on the browse option and view the table fields within details.
7. We can see all the old slugs details in the below screenshot.
8. Check all tables at the left side bottom of the tables, as shown in the screenshot, and hit the delete option; all the tables should be deleted.
The below screenshot shows the Single Database field delete alert with an example.
Means no more old slug URLs in the database the problem with the WordPress Automatic Old URL Redirecting to New URL when a post’s URL or slug changes are fixed or removed.
If you want to edit or save a new URL instead of an old URL, you can follow all steps that don’t delete, and you can edit each field and update the new URL or slug as per below screenshot.
1. Top 20 Free Yoast SEO Alternatives & Competitors for WordPress Websites
2. WordPress Development Tips to Supercharge Your Projects
3. 16 Best Free SEO WordPress plugins for your Blogs & websites
4. 16 Best (free) AMP – (Accelerated Mobile Pages) WordPress Plugins
5. Top 50 Best (Free) WordPress WooCommerce Plugins for your storefront