HM Redirects #5 in SEO & Metadata
Simple plugin for handling WordPress redirects in a scalable manner.
★ 29stars
257kcomposer installs
10forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/humanmade/hm-redirects/archive/refs/heads/master.zipAlso on Packagist as humanmade/hm-redirects:
composer require humanmade/hm-redirectsFrom the readme
HM Redirects
Allows to redirect one path to another path on the same domain.
Architecture
Redirects are stored as a custom post type and use the following fields:
- postname to store the md5 hash of the From path. This column is used because it is indexed, and allows fast queries. md5 is used to simplify the storage.
- posttitle to store the From path.
- postexcerptto store the the To path.
Tips
This plugin uses wpsaferedirect() to redirect. You will have to whitelist your redirect target domains using WordPress' allowedredirecthosts filter, otherwise the redirect will not work.
One way to get a list of redirect target domains is to run the WP-CLI command: wp hm-redirects find-domains. Another is to add them dynamically just-in-time using the filter hmredirectsmatchedredirect.
Attributions
Props for the data storage approach to VIP's WPCOM Legacy Redirector.
Contributing
Before tagging a release
Update the version string on line 8.
Running tests
Currently the plugin's automated tests run against PHP 7.4 and WP 5.8. PHPUnit doesn't need to be installed, however:
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| 0.7.5 | May 21, 2025 | — | — |
| 0.7.4 | Mar 20, 2025 | — | — |
| 0.7.3 | Apr 22, 2024 | — | — |
| 0.7.2 | Aug 31, 2022 | — | — |
| 0.7.1 | Mar 15, 2022 | — | — |
| 0.6.3 | Mar 15, 2022 | — | — |
| 0.7.0 | Jan 21, 2022 | — | — |
| 0.6.2 | Jan 21, 2022 | — | — |
| 0.6.1 | Nov 8, 2021 | — | — |
| 0.5.4 | Nov 8, 2021 | — | — |
| 0.5.3 | Nov 4, 2021 | — | — |
| 0.6.0 | Nov 4, 2021 | — | — |
| 0.5.2 | May 25, 2020 | — | — |
| 0.5.1 | Jun 3, 2019 | — | — |
| 0.5.0 | Mar 28, 2019 | — | — |
| 0.4.2 | Nov 8, 2018 | — | — |
| 0.4.1 | Oct 24, 2018 | — | — |
| 0.4.0 | Jun 6, 2018 | — | — |