Redirection is a WordPress plugin to manage 301 redirections, keep track of 404 errors, and generally tidy up any loose ends your site may have. This is particularly useful if you are migrating pages from an old website, or are changing the directory of your WordPress installation.
Note: this is the current 'trunk' version of Redirection. It may be newer than what is in the WordPress.org plugin repository, and should be considered experimental.
Redirection can be installed by visiting the WordPress.org plugin page:
https://wordpress.org/plugins/redirection/
Redirection provides a large set of WordPress action and filter hooks that can be used to extend or customise the plugin. These can found on the Redirection Hooks page.
Access to the Redirection admin interface is given to users who can manage_options. You can modify this with permission filters, described on the Redirection permissions page.
Redirection is mostly a PHP plugin, but does contain files that need to be built. For this you'll need Node and pnpm installed.
- Node.js >= 12.14.0
- pnpm
- Composer (for PHP development)
Install JavaScript dependencies:
pnpm installInstall PHP dependencies (for linting and testing):
composer installThe UI is built with React using @wordpress/scripts. To start development with hot-reload:
pnpm startTo create a production build:
pnpm buildRun all linters:
pnpm lintOr run individually:
pnpm lint:php- PHP linting (PHPCS and PHPStan)pnpm lint:js- JavaScript lintingpnpm lint:css- CSS lintingpnpm lint:ts- TypeScript type checking
PHP code can be auto-formatted with:
composer formatPHP Unit tests:
pnpm test:unitOr directly via Composer:
composer test-unitPHP Integration tests (requires WordPress):
First, start the WordPress environment:
pnpm wp-env:startThen run the integration tests:
pnpm test:integrationTo stop the environment:
pnpm wp-env:destroyJavaScript tests:
pnpm test:jsEnd-to-end tests:
pnpm test:e2eRun all tests:
pnpm testCreate a release build (builds assets and creates a zip file):
pnpm releaseCreate just the plugin zip without releasing:
pnpm plugin:zipRelease to WordPress.org SVN:
pnpm release:svnGenerate API documentation:
pnpm docPlease raise any bug reports or enhancement requests here. Pull requests are always welcome.
You can find a more detailed description of the plugin on the Redirection home page
Translations can be added here:
https://translate.wordpress.org/projects/wp-plugins/redirection