I’d first get the attachment ID and with the attachment ID you could use wp_delete_attachment($att_id)
Related Posts:
- How do I delete all UNUSED images from my uploads directory?
- Did I do it right? Deleting images after deleting product. Woocommerce
- How can I store an image in the database with Transients API?
- Is there a shortcut to change bulk BMP images to JPG images in a site?
- WP 3.4 has missing photo data
- Update image links in database
- Woocommerce featured image of page – not product
- Image thumbnails not available post migration, but still accessible via direct URL – DB issue
- Image upload appearing as broken images following server move
- I got an issue after i migrated a site
- wordpress (woocommerce) add image to media library programmatically python
- Resize into square the single product image in woocommerce without cropping [closed]
- Upload media only to DB
- insert image alongwith with custom data via a frontend form
- Images are not showing after moving WordPress installation from server to localhost?
- Remove “%” from strings in serialized arrays in wp_postmeta
- Images not found after migrating WordPress website
- How to make footer area transparent? Using Avada and WordPress [closed]
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- Hide image gallery in Woocommerce if NO image [closed]
- Can I achieve this with WordPress?
- Save media files (images) to database instead of the filesystem
- Optimise wordpress database using SQL after deleting registered images from Media Folder
- A query to substitute images paths in gutenberg (website migration)?
- When upload a PNG a noise appears in the thumbnails
- JPG Image extension not inserting into Custom table of wp
- Exclude first image from a Woocommerce image gallery
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- How can the alt be added to this wooCommerce category image?
- Bypass wp_safe_remote_get()?
- Image thumbnail on single product issue | WooCommerce
- Images not showing after moving site
- Thumb doubles the image file size
- Why images are disappearing on WordPress web site?
- What’s the proper way to find and remove duplicate images from posts and the media library?
- get_post_gallery with Gutenberg
- Insert an image into a post by API
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- Creating a rotating header /image slider using theme customization
- Add aditional class to get_avatar when showing image
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Double thumbnails?
- No srcset for hard-cropped thumbnails
- Slider image issue in wordpress
- Limit author image size
- Query for recent images across multiple posts
- Get image alt attribute just by image URL
- Is there a way to get attachment data?
- get_children() not working properly – Only on one post?
- Warning: getimagesize() [function.getimagesize]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 [closed]
- How to add data attribute to all images in posts [closed]
- How to order images in a post in WordPress 3.3?
- WordPress crops images differently on retina screens?
- Override img class in gallery
- Exclude images from “inserted into post” when trying to get attachments
- Set jpeg_quality for certain post-types
- WordPress automatically downscaled images larger that original
- Move Image Captions Inside Link ( tag) if Added
- Sharing images to social media – issue with aspect ratio
- How to add custom classes to figure element only if image has caption?
- I want to use the GD image editor for just one function then switch back to ImageMagick
- 409 error (Conflict) when trying to insert an image into a post
- Exclude image titles from search results
- Does WP create multiple images?
- Thumbnails generated by “add_image_size” are not removed when removing media
- WordPress 3.0 embedded images
- TImthumb not working for absolute path
- Correctly implementing the Facebook Like button
- Mass crop images: Landscape images -> Portrait images
- Change image name during uploading sequentially
- Store in media library image uploaded from url
- WooCommerce: remove sample & dummy data
- How to redirect homepage to actual URL?
- Get images attached to a specific page
- add_image_size function not working
- image resizing on post content without css and html tags
- Stop WordPress compressing images? – Quality is terrible
- Cropped image file size larger than original, is it normal?
- Using mysql to replace img src?
- wordpress add image size crop function not working in version 3.8
- Doing a bulk replace of images through back-end
- How do I make the product image smaller on a WooCommerce product page?
- I would like to set a FULL SCREEN background image to all my pages (same way it is on my home page)
- How to change a theme’s footer image
- Enlarge Featured WordPress Images
- WordPress 4.4.2 upload give error, can’t write is upper directory allowed to be written
- update_post_meta performance in a loop woocommerce
- How to attach 1000’s of unattached images
- Change wordpress default upload path to another domain
- Responsive images in Bootstrap 4 slider
- How can I add an “Attach image to this post/page” link on the Add Media lightbox?
- Create slider option in editor
- Assign one featured image to multiple posts?
- Why are my ‘medium’ images the wrong size
- How can I hide previous_image_link() on first attachment page?
- An image on my site is showing as the wrong image [closed]
- Set padding for all content except images and few more elements
- How to change the alignment of the background image for small screen (tablet/smartphone etc.)
- get_theme_file_uri function not showing background image inside data-setbg in html