[wp-hackers] Getting the entire HTML page generated from WordPress

Otto otto at ottodestruct.com
Mon Feb 6 19:10:12 UTC 2012

Use output buffering. On the init action, do an ob_start(), then hook
a function to the shutdown action hook and you can do an
ob_get_clean() to get the contents, filter them as you will, then echo
the result.

Not the best, but the only whole-page method I know of.


On Mon, Feb 6, 2012 at 12:58 PM, Mario Peshev <mario at peshev.net> wrote:
> Hello everyone,
> I'm trying to intercept the entire HTML page generated on a page load in
> WordPress. the_content() is not enough as I need some filtering in the meta
> tags, footer, sidebar etc.
> I've been looking for some filters and the HTTP API, but nothing seems to
> work on a page basis, i.e. post-filtering of every element in the entire
> DOM tree.
> Any tips on this?
> Mario Peshev
> Training and Consulting Services @ DevriX
> http://www.linkedin.com/in/mpeshev
> http://devrix.com
> http://peshev.net/blog
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list