Title: CPT + ACF Permalink
Last modified: November 21, 2020

---

# CPT + ACF Permalink

 *  Resolved [webworklife](https://wordpress.org/support/users/webworklife/)
 * (@webworklife)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/cpt-acf-permalink/)
 * I have a CPT called Documents. I have an Advanced Custom Field associated with
   that CPT to upload a PDF file. I would like the CPT singular page to redirect
   to the Document/PDF file ([https://www.palmer-hamilton.com/wp-content/uploads/2020/11/daisy_pricer_.pdf](https://www.palmer-hamilton.com/wp-content/uploads/2020/11/daisy_pricer_.pdf))
   instead of the Document post page as seen here – [https://www.palmer-hamilton.com/documents/daisy-pricing/](https://www.palmer-hamilton.com/documents/daisy-pricing/)
 * The ACF field name is “upload_file”, not sure how to change the permalink or 
   setup a redirection to this field, any help you can provide would be greatly 
   appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcpt-acf-permalink%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [5 years, 6 months ago](https://wordpress.org/support/topic/cpt-acf-permalink/#post-13698544)
 * I’d look into making use of [https://developer.wordpress.org/reference/hooks/template_redirect/](https://developer.wordpress.org/reference/hooks/template_redirect/).
   I believe you should be able to do something close to what you need with the 
   code below. Please adjust accordingly to make sure you’re fetching the ACF data
   properly:
 *     ```
       function webworklife_redirect_to_document() {
           $pdf_url = get_field( 'upload_file' );
   
           wp_redirect( $pdf_url );
           exit();
       }
       add_action( 'template_redirect', 'webworklife_redirect_to_document' );\
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘CPT + ACF Permalink’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/cpt-acf-permalink/#post-13698544)
 * Status: resolved