If you visit the site again you will find the header image missing. I had a valid image loaded earlier which is why you probably did not notice the problem when you first visited the site.
I want to be able to delete this invalid/missing image from the list of custom uploaded headers in the admin console so that I can enable the random selection of header images. If I do it right now, every once in a while a visitor to the site will encounter this image.
As you probably noticed I am using the Twenty Eleven theme.
I hope I am explaining the situation/problem clearly.
Thanks for you explanation. That makes more sense although it sounds like it might be a little difficult to remove. Unfortunately, in the Twenty Eleven theme, clicking the “Remove Header Image” button simply removes it from the site but leaves it in the list of uploaded headers. As you’ve seen, it’s not a valid image and if it’s not displaying in the Media library it obviously can’t be deleted from there either.
The only other option I can see is to remove it manually from the database using a tool like phpMyAdmin, which is usually provided in most hosting packages. If you’re not familiar with using this tool then it’s best not too as deleting the wrong data can obviously cause all sorts of issues with your site.
Have you used phpMyAdmin before? If not, and you’re comfortable providing me with access to your hosting account, I can have a look in your database and delete the offending data for you. Let me know how you’d like to proceed and if you’d like me to take a look I’ll provide you my email address.
Anthony, I’m reasonably comfortable working with the database so if you are able to give me specific instructions on what to modify, I should be able to do it myself otherwise I guess I will need to provide you the credentials to access the server.
In that case, I’ll leave you to do it. Just a couple of notes to start…
* Can’t stress this enough: Before you start, please make sure you do a backup of your database. You can never be too careful! *
* The table names that I make reference to start with “WP_”. Depending on how your WordPress setup was configured, it’s possible that your table names start with something else, as this can be set in the WP configuration file. *
Within phpMyAdmin, open your database. Using the “SQL” tab, run the following query
SELECT * FROM wp_postmeta where meta_value = 'custom-header'
This will display all rows within WP_POSTMETA that are your custom header images.
Make a note of the value(s) in the POST_ID column. Depending how many header images have been uploaded, you may get multiple rows returned.
Run the following query, replacing “value1, value2, value3” with a comma seperated list of the POST_ID’s you wrote down from the previous query. If the last query only returned one row, then simply put that single figure in the brackets
SELECT * FROM wp_posts where id in (value1, value2, value3)
The header row that you want to delete should be returned using this query. Look at the POST_NAME column to determine which row to delete. Hopefully it will contain part of the img name that is causing the problems. You can click the red “X” at the very left of a row, to delete that single row of data. Make a note of the number in the ID column for the row that you delete.
Run the following query, replacing “post-id-value” with the value you wrote down in the previous step (ie. the row that you deleted)
SELECT * FROM wp_postmeta where post_id = post-id-value
This will return multiple rows from WP_POSTMETA that are related to the data contained in the WP_POSTS table. There will most likely be 4 rows returned. You can delete these 4 rows.
You should now be able to return to your WordPress Dashboard and hopefully when you view the APPEARANCE > HEADER menu option, the offending header will no longer be there.
If all worked well, pat yourself on the back and go have a coffee! 😉