I can get the image header with



wp eval "echo get_header_image();"

But how can I change that ? I tried

set_header_image(url) and Custom_Image_Header::set_header_image

with no success.

  • are you using default theme or customized theme? Aug 16, 2019 at 4:18
  • I installed a theme
    – yarek
    Aug 16, 2019 at 9:13
  • Which theme are u using? Aug 16, 2019 at 9:14
  • Used theme: EnvestPro Lite. It is a classic theme where you set the image header in customize->theme->header
    – yarek
    Aug 16, 2019 at 13:01

1 Answer 1


get_header_image() uses get_theme_mod() to get the saved header image, so I would assume the following example should be used to update the saved value. And set_header_image does the same thing at the end of it, after all the different checks.

set_theme_mod( 'header_image' , 'your-image-url-here' );

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.