WP Singular Post Redirect
Here’s a WordPress plugin to handle 301 redirects for duplicate posts and revisions. The plugin will redirect users to the most relevant post based on title, tags, or related content. It ensures the frontend presents singular posts for better SEO and user experience.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/kimjac/301-redirect-plugin-wordpress/archive/refs/heads/main.zipHere’s a WordPress plugin to handle 301 redirects for duplicate posts and revisions. The plugin will redirect users to the most relevant post based on title, tags, or related content. It ensures the frontend presents singular posts for better SEO and user experience.
Key Features of the Plugin:
-
301 Redirects:
- Checks for duplicate posts by title.
- Redirects to the most relevant published post.
- Falls back to tag-based related posts if no exact title match is found.
-
Prevention of Duplicate Posts:
- Prevents publishing duplicate posts by setting their status to "draft."
-
SEO Optimization:
- Ensures only one version of a post is accessible to users and search engines.
Installation Instructions:
- Copy the code into a file named
wp-singular-post-redirect.php. - Upload the file to the
/wp-content/plugins/directory. - Activate the plugin from the WordPress admin panel.
Let me know if you need further enhancements or explanations!