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

Is it possible to hide content in Post Preview (that is not hidden when the post is published)? I have customised single.php quite extensively and there are a few elements that I do not want my authors to load up every time they preview their post.

share|improve this question
up vote 1 down vote accepted

There is the handy is_preview function.

So somewhere in your single.php.

if (!is_preview()) {
     // Show stuff that doesn't belong on a preview.
share|improve this answer
Ah, I was not aware of that function, excellent! – Christine Cooper Jan 3 '13 at 13:55

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.