Last Updated: February 25, 2016
·
6.496K
· romulodl

How to change http header 'Content-type' in Wordpress

function changeHeaders($headers)
{
    $headers['Content-Type'] = 'application/json; charset=utf-8';

    return $headers;     
}
add_filter('wp_headers', 'changeHeaders');

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#php
#wordpress
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside