-
Notifications
You must be signed in to change notification settings - Fork 16
Adding Redirects from Post Meta Fields
Redirects from post meta fields can be added using this command:
wp wpcom-legacy-redirector import-from-meta --meta_key=my-post-meta-key
The plugin will search for all posts that have a post meta field named "my-post-meta-key" (or whatever key name you decide to use) and create a redirect from the address found in the meta field to the post that has that meta field. The meta field can contain relative or absolute URLs, but we recommend specifying absolute URLs where possible. So, for example, if you wanted to redirect all requests to http://old-domain.com/old/legacy/path/
to post ID 5, you would set the value of the post meta field named "my-post-meta-key" to http://old-domain.com/old/legacy/path/
on the post with ID 5.
If you only want to process a certain number of posts at a time, you can add these optional command line parameters:
[--start=start-offset] [--end=end-offset]
Where, for example, start-offset might be "1" and end-offset might be "1000".