Resolving wp_redirect and the “Headers Already Sent” message

Often I come across the need to use wp_redirect when working with WordPress, however it often comes up with the “Headers Already Sent” error, below is a way to resolve this in WordPress websites. Just add it into your functions.php file and away you go!

function app_output_buffer() {
ob_start();
}
add_action('init', 'app_output_buffer');

Get a Free QuoteToo hard basket? Call us! ×
  • Your details
  • Project details
  • More details