GPM Short URLs Redirector
GPM Short URLs Redirector
Description
This plugin creates a custom post type whose single URLs immediately redirect to a specified external link using a permanent 301 redirect.
Key Features:
Dedicated CPT: Introduces “URLs Redirects” for separation from standard posts.
301 Redirects: Uses permanent redirects for SEO-friendly link juice transfer.
Custom Slug: Defaults to the /go/ base slug (e.g., yoursite.com/go/my-product).
Secure: Implements nonce checks and permission verification on save operations.
Installation
Upload the gpm-short-urls-redirector.php file to the /wp-content/plugins/ directory.
Activate the plugin through the ‘Plugins’ menu in WordPress.
Navigate to the new Link Redirects menu item in your WordPress admin.
Click Add New and enter a title for the slug (e.g., my-link).
Enter the full external destination URL in the provided meta box.
Publish the post. Your new redirect link is ready!
Note: If your redirect links do not work immediately after activation, navigate to Settings > Permalinks and click ‘Save Changes’ once to flush the rewrite rules manually.
Reviews
Changelog
1.0.0
Initial release.
Implemented Custom Post Type ‘gpm_external_link’ with ‘go’ rewrite slug.
Added meta box for destination URL input.
Implemented 301 redirection logic on the single post template.
Ensured security compliance (nonces, capabilities, sanitization).
Added i18n support and comprehensive plugin headers.
