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

when does <!--nextpage--> get processed by wordpress filtering. i am adding multiple paged posts in post content on the content_save_pre and this is good for rendering my shortcodes, but <!--nextpage--> doesnt get processed and shows up as an html comment

share|improve this question
As Rarst said, it is parsed on displaying the post, so your content_save_pre should be a good place to insert it. Does it show in the editor if you edit the post again? Can you see a difference in the database between a break entered in the editor and one by your code? Are you sure you used <!--nextpage--> and no spaces in that code? – Jan Fabry Dec 31 '10 at 10:27
up vote 2 down vote accepted

I am not sure what you mean by rendering shortcodes at that stage, they are usually rendered when content is retrieved for display.

nextpage tag is processed in setup_postdata() ( source ), which is called by the_post(). In other words - during Loop.

share|improve this answer
I assume he means that he inserts shortcodes and <!--nextpage--> tags in the content_save_pre hook, and the shortcodes get processed like they should, but the page breaks not. – Jan Fabry Dec 31 '10 at 10:28
yes Jan you are correct, @Rarst i will give setup_postdata() a try. thank you. – afj176 Dec 31 '10 at 20:53

As an update. content_save_pre does process <!--nextpage--> i had the <!--nextpage--> tag inside the shortcode function, once i moved them outside, all was good.

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.