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 using

add_action('the_content', 'myFunction', 10) 

to append data to the end of the content.

How can I place content at the beginning of the content?

share|improve this question
up vote 5 down vote accepted

the_content is also a filter, into which the content is passed as an argument. You simply prepend your content and then return like so.


function prepend_this($content)
    $content = "string to prepend" . $content;
return $content

share|improve this answer
Additional examples themify.me/docs/hooks – here Nov 14 '14 at 7:31

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.