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'm making a course plugin for a university in England. I'm looking to put some default placeholder text in the main post content area, on the admin side. Its the rich text editor I want it to go behind. I might just be typing the wrong words, but can't find it here... preferably a non js thing...

Basically something like 'Use this area to write an introduction to the course...'.


share|improve this question
Here ya go: github.com/tripflex/wp-tinymce-placeholder – Myles Mar 22 at 21:11

You can change 'post' to which ever post type you want to apply the default content to.

add_filter( 'default_content', 'wpse57907_default_content', 10, 2 );
function wpse57907_default_content( $content, $post ) {
    if ( 'post' == $post->post_type )
        $content = 'Use this area to write an introduction to the course...';

    return $content;


I'm not sure you can add placeholder text to tinymce editors. The followng method will add a placeholder to the underlying textarea (you can view it on the 'html', soon to be 'text' tab):

function wpse57907_add_placeholder( $html ){
    $html = preg_replace('/<textarea/', '<textarea placeholder="my place holder text" ', $html);
    return $html;

But this does not appear on the visual editor (as I say, I'm not sure placeholders work with TinyMCE - if someone knows how, please comment.).

share|improve this answer
Hey Stephen, thanks for quick response that's almost exactly what I'm looking for except do you know any way to make it like placeholder text? So it will disappear as soon as they focus in the field? – danbrown Jul 9 '12 at 15:35
I've updated my answer... – Stephen Harris Jul 11 '12 at 19:39
TinyMCE is an iframe with regular HTML and contenteditable if I remember this correct. The only way to let text act like a HTML5 placeholder is some (probably fragile) JavaScript. – toscho Jul 11 '12 at 19:50
Oh ok thanks, the first method does the job anyway, I'm probably being a bit OCD about it. Cheers for the answers :) – danbrown Jul 13 '12 at 8:13
Thanks for this, I adapted it along with a TinyMCE plugin to work with WordPress :) – Myles Mar 22 at 21:11

This could be the answer: http://codepen.io/flesler/pen/AEIFc

Just adding the following CSS will make it work like a placeholder:

[contenteditable=true]:empty:before {
    content: attr(placeholder);
    display: block; /* For Firefox */

We just need to find a way to add a data-attribute to the contenteditable element in the tinyMCE and also add the little bit of CSS to it to affect the content editable.

share|improve this answer

Based off a placeholder plugin I found for TinyMCE, I adapted it to work for WordPress, and created a repo specifically for it. Works perfectly for me!


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.