I have a menu item I created called 'View Certificates' and a sub menu item called 'Add Certificates'. The Add Certificates page is just a file upload page. After the file uploads successfully, I want it to redirect back to the 'View Certificates' page.

All my code is in the functions.php file. How do I go about doing this redirect?


You can use wp_redirect

  • im getting errors about not modifying the headers – dtj Oct 15 '11 at 16:28
  • What is the exact error you get? – chifliiiii Oct 15 '11 at 18:01
  • Warning: Cannot modify header information - headers already sent by (output started at /wp-admin/admin-header.php:34) in /wp-includes/pluggable.php on line 934 – dtj Oct 15 '11 at 18:54
  • wp_redirect acts the same as "php header( 'Location:" You can not output any html before you run it. If you ar ein functions.php you should be able to do it. If you form use javascript maybe you can add a callback and do a javscript location.replace="yoursite.com" – chifliiiii Oct 16 '11 at 0:02

How about standard header( 'Location: http://ViewCertificatesPage' );



wp_redirect is a function which helps you to redirect http://codex.wordpress.org/Function_Reference/wp_redirect

& you can run it in conditions with http://codex.wordpress.org/Conditional_Tags

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.