Title: [Plugin: Quick Page/Post Redirect Plugin] Add redirect programatically?
Last modified: August 20, 2016

---

# [Plugin: Quick Page/Post Redirect Plugin] Add redirect programatically?

 *  Resolved [alxvallejo](https://wordpress.org/support/users/alxvallejo/)
 * (@alxvallejo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-quick-pagepost-redirect-plugin-add-redirect-programatically/)
 * I’m trying to use this syntax but the url does not update:
 *     ```
       add_post_meta($ThisPageID, _pprredirect_active, 1, true);
       add_post_meta($ThisPageID, _pprredirect_type, 301, true);
       add_post_meta($ThisPageID, _pprredirect_url, 14417, true);
       ```
   
 * The type and active work but not the url. This code is ‘nasty’ to go through.
   Any help?
 * [http://wordpress.org/extend/plugins/quick-pagepost-redirect-plugin/](http://wordpress.org/extend/plugins/quick-pagepost-redirect-plugin/)

Viewing 1 replies (of 1 total)

 *  [Don Fischer](https://wordpress.org/support/users/prophecy2040/)
 * (@prophecy2040)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-quick-pagepost-redirect-plugin-add-redirect-programatically/#post-3055039)
 * alexallejo,
    You can add data that way. It looks like you are trying to pass 
   the post ID to the redirect URL, maybe? You have to pass a string to the URL.
 * Try this,
    `add_post_meta($ThisPageID, '_pprredirect_url', 'http://someurl.com/
   text/', true);`
 * The other two allow for numeric data (active is bool value, type is numerical).
 * Sorry about the code being ‘nasty’, but is is very clean and almost everything
   is commented… but there IS a lot going on – it has to hook into a lot of different
   functions for the regular redirects and the Quick Redirects are an entire different
   thing – as they are separate from the individual ones. Additionally, there are
   a lot of checks that have to happen to make it all work correctly and a lot of
   crazy code to make it happen.
 * Let me know if you have further issues and I will see what I can do to help. 
   Email me directly ([plugins@fischercreativemedia.com](https://wordpress.org/support/topic/plugin-quick-pagepost-redirect-plugin-add-redirect-programatically/plugins@fischercreativemedia.com?output_format=md))
   for the fastest response.
 * Warm regards,
    Don Fischer

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Quick Page/Post Redirect Plugin] Add redirect programatically?’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/quick-pagepost-redirect-plugin_8d7b6f.
   svg)
 * [Quick Page/Post Redirect Plugin](https://wordpress.org/plugins/quick-pagepost-redirect-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quick-pagepost-redirect-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quick-pagepost-redirect-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/quick-pagepost-redirect-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quick-pagepost-redirect-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quick-pagepost-redirect-plugin/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Don Fischer](https://wordpress.org/support/users/prophecy2040/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-quick-pagepost-redirect-plugin-add-redirect-programatically/#post-3055039)
 * Status: resolved