Debug output during filter execution doesn’t work

You need to kill the script. Add die; after your var_dump.

WordPress post submissions operate on a post/redirect/get principle. The reason you don’t see the output is that the page has been reloaded. That is, you post the form, the form gets processed, and the page is redirected back to itself but without the $_POST data. It helps prevent “double-submissions”.

You have to kill the script to prevent the redirect or the page you end up seeing is not the page with the output you are expecting to see.

You should be able to log errors to a file if you use error_log or look into some more complicated debugging tools.

Leave a Comment