WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted

You can use wp_redirect

share|improve this answer
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' );


share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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