WordPress TwentyTen Custom Header setting in the db

When we move a WordPress site from development to production we update the URL in the following db values:

  • in the GUID value of each post in wp_posts
  • in the wp_options table, the option_name of home
  • in wp_options, the option_name of siteurl

In a recent move, we found that the custom header in the TwentyTen theme was not displaying correctly when we moved across servers. Seems that when you use a TwentyTen theme or child theme, a wp_option is added to the table – theme_mods_twentyten. The value of this contains all the theme mods including the the URL of the header image. The query below would update the URL in this value:

  • mysql –batch –skip-column-names -e “use $CURRENTDB;UPDATE wp_options SET option_value = replace(option_value, ‘”$OLDSITENAME”‘, ‘”http://$NEWSITENAME”‘) WHERE option_name = ‘ theme_mods_twentyten’;”

Note: When using a copy of the TwentyTen theme, the option_name value will be theme_mods_NameOfTheTheme.

Comments are closed.