Save WordPress Custom Headers on Theme Change

When changing themes in WordPress custom headers are lost and must be re-uploaded. This even applies when installing a child theme and can be quite a hassle when using themes like Twenty Eleven with potentially a great number of header images. This can be fixed with the following MySQL commands, issued from the command line or phpMyAdmin:

  1. Get the exact name WordPress uses for the new theme with:
    SELECT option_value FROM wordpress_database_name.wp_options WHERE option_name = 'current_theme';
  2. Associate the old images with the new theme:
    update wordpress_database_name.wp_postmeta set = 'new_theme_name' WHERE meta_key = '_wp_attachment_is_custom_header';


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>