Trey Connell

April 22, 2009 | In: Development, Wordpress

Automatically Insert Text in a WordPress Post

Sometimes you want to automatically insert copy into the body of your WordPress post without having to manually paste it in every time. I ran across this handy function from wprecipes.com that does just that:

Edit your theme and paste the following code into your functions.php file:

add_filter( 'default_content', 'my_editor_content' );

function my_editor_content( $content ) {
    $content = "I want this text to be automatically included.";
    return $content;
}
?>

Comment Form

Tradeomics

Twitterings

Recent Comments

Buy Awesome T-Shirts!

I hate pants t-shirt