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 created a form. On success of the form, I am redirecting the user the their dashboard. Now, I want to be able to show a success message/notice on the dashboard.

What is the convention to show such messages ?

share|improve this question
Have you tried our search engine? – toscho Dec 10 '12 at 20:44
Are you using Settings API? – Mamaduka Dec 10 '12 at 22:39
@toscho I did but had misunderstood the function. Thanks. – Prakash Raman Dec 11 '12 at 9:54
@Mamaduka if you mean the options page, I have. Thanks. – Prakash Raman Dec 11 '12 at 9:54
up vote 1 down vote accepted

When you redirect the user to the admin dashboard pass on a GET variable named "success_notice", for example. So you get a URL like this: /wp-admin/index.php?success_notice=1.

With that setup, just add the code that shows the success message on the dashboard only if that GET variable is set.

add_action('admin_notices', 'wpse75629_admin_notice');

function wpse75629_admin_notice()
    global $pagenow;

    // Only show this message on the admin dashboard and if asked for
    if ('index.php' === $pagenow && ! empty($_GET['success_notice']))
        echo '<div class="updated"><p>Your success message!</p></div>';
share|improve this answer
Thank you, had misunderstood the function of the "admin_notices" hook. – Prakash Raman Dec 11 '12 at 9:53

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.