Support » Fixing WordPress » Removing header images, keep in library

  • I want to use random headers on my website. One of the images I originally thought I’d use was one that was already in my media library and I selected it from there. But now I no longer want to use it as a header. HOWEVER, I still use the image throughout the site (not as a header) so I don’t want to delete the image from the media library. Is there another way to tell WordPress to stop associating an image with the header? I’m not afraid to go into file manager in my host or play with the MySQL database – I just don’t know what to look for.

Viewing 7 replies - 1 through 7 (of 7 total)
  • what theme are you using?

    I’m using the Spacious theme. But I think the random header option is just part of the basic wordpress codex, isn’t it?

    Can you kindly share a snap of that configuration page.

    Happy to!

    Here is the configuration page. You see two headers uploaded. I want to remove the first image, but I use that image in other posts on the site so I don’t want to delete it from the media library.

    Config page.

    And here is where I can see in the media library that the image file has been marked as a header.

    Media Library

    As I can see, there is no such option with your theme.

    Kindly try to change the image with a new image first.

    After that Delete the new image from Media Library.

    That is not a viable solution for me because I use the image elsewhere so I don’t want to delete it from the media library.

    However, with a little trial and error and browsing in phpMy Admin, I figured it out. Here’s what I did for anybody else in the situation.

    I went into the wordpress database and to the table _postmeta and looked in the meta_key for content with the word “header” and discovered two entries that had “_wp_attachment_is_custom_header” as the meta_key. As I had two images currently uploaded as “headers” this seemed promising. I looked at the post_id in the two entries and the post_id corresponded to the post_id of the two header images. Even more promising! I went back into wordpress, uploaded another image as a header, and voila! A third entry in _postmeta with “_wp_attachment_is_custom_header” appeared. I had it!

    So, I simply deleted the table entry for the image I no longer wanted WordPress to consider a header, refreshed the header configuration page, and the image was no longer displaying as an uploaded image. I checked my media library and the image was still there (yippee!) but it no longer had “Header Image” noted next to the file name.

    Not for the faint of heart, but worth it so I didn’t have to delete and re-upload the image and fix links to the old image across the site.

    Its a bit risky. But congrats, you did that.:)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Removing header images, keep in library’ is closed to new replies.