I have a site that currently have a some part of the headers like:

Vary: Accept-Encoding, Cookie

I want to modify it to be:

Vary: Accept-Language

I tried the suggestions here using this code

add_action( 'send_headers', 'mod_header_test' );
   function mod_header_test() {
   header( 'Vary: Accept-Language' );

But the results I'm getting is:

Vary: Accept-Encoding, Accept-Language, Cookie

How do I completely erase the existing Vary header using the correct action/filter and replace it with: Vary: Accept-Language ?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.