• aplikacije

    (@aplikacije)


    Hello,

    our page uses post type – gallery to display images attached to a post in a gallery. The images are uploaded through “Add images” button under “Image Gallery” heading on “Add new post” page.

    However, if we decide to remove an image from that gallery it will still show on our website. I checked in “wp-post” table in our DB and saw that the field “post-parent” of the removed image doesn’t change to 0 as it should, but it stays populated with the id of the post we inserted it to.

    The only current solution is going to “Media files” and manually detaching it from that post, which is inconvenient due to large amount of media files that are uploaded.

    Is there any solution to this, any chunk of code that should be entered or planned updates to WordPress that could fix this.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s expected behavior for images to remain attached whether actually part of post content or not. We can debate on whether that’s appropriate or not, but that’s the way it currently is. You can search the Trac system to see if anything is pending or not. Altering current behavior would require altering editor and gallery script’s image removal routines.

    In any case, usually removing images from content would cause them to not remain when the site is viewed, even when still relationally attached in the DB. If a removed image remains visible anyway, caching may be at play. The exception would be if the gallery generates content based on a query for all child attachments. If it did, there ought to be a way to exclude certain images given the default behavior of WP regarding attachments.

    It appears that you use an Elementor image gallery. We don’t support Elementor here. I suggest you ask for suggestions in your theme’s or Elementor’s dedicated support channel.

Viewing 1 replies (of 1 total)
  • The topic ‘Image staying connected to post after removing’ is closed to new replies.