
Sometimes, you may need to leave a private note (Only visible to admins) to a post, but there’s no built-in solution in WordPress to do it. So, here’s a nice hack I use on my blogs.

Sometimes, you may need to leave a private note (Only visible to admins) to a post, but there’s no built-in solution in WordPress to do it. So, here’s a nice hack I use on my blogs.
Here's the code you need to add to your functions.php file:
add_shortcode( 'note', 'sc_note' );
function sc_note( $atts, $content = null ) {
if ( current_user_can( 'publish_posts' ) )
return '<div class="note">'.$content.'</div>';
return '';
}
Once done, simply add the following shortcode in your posts:
[note] This is a personal note that only admins can see! [/note]
Note that the note will be displayed with a <div class="note"></div> tags, so you can use it to give a specific style to your notes!
48 Responses
Hey, That was an awesome Share. Nice idea.
The potential of functions.php is almost infinite
Cheers…
Sweet little tip! Going to use this at Perishable Press. Thanks!
I never imagined that Wordpress can do it. This platform is just amazing!
This is really great, I usually just use notepads and its such a pain and you are right there are many times I want to add notes that only I can see.
Thanks again!
Ann
Oh yes, it’s cool. WordPress and PHP have great resources.
This theme is very nice
Very cool shortcode. If I ever had some some additional admin’s this could be very useful.
Wow, this is a pretty nice little technique. At least this way, I won’t forget to update my typos and spellcheck things.
Nice idea
OMG!
this is really fantastic code i think it is so useful and imformative post. Keep it up!
WoW! That was awesome. Thanks a lot.
That’s pretty straightforward but also kinda risky. If you accidentaly misspell something the note will be visible to everyone. I’d rather send an email to the other admins – takes only a bit longer.
Great tips buddy. It would be a new change in my blog. I’m gonna implement it today itself..
Its been almost an hour since I am on your website, and I’m learning something new every minute. Great work.
Thanks for posting
another nice useful tip, thanks..
Very useful for multiple admin sites, thanks
If I wanted to use this code, how exactly do I add the code to the function file. I use wordpress.
Thanks!
Trackbacks: