Codex

Function Reference/wp delete attachment

Contents

Description

This function deletes an attachment

Usage

 <?php wp_delete_attachment$postid ); ?> 

Example

To delete an attachment with an ID of '76':

<?php delete_post_meta( 76 ); ?>

Parameters

$postid
(integer) (required) The ID of the attachment you would like to delete.
Default: None


Related

wp_get_attachment_url()

This page is marked as incomplete. You can help Codex by expanding it.