The reverse of wp_insert_post

You’re looking for wp_delete_post.

<?php
$some_post_id = 1;
wp_delete_post($some_post_id);

The above will delete the post with ID 1 — well, it will actually set it to a “trash” status. You can delete the post for real by setting the second parameter of wp_delete_post to true.

<?php
$some_post_id = 1;
wp_delete_post($some_post_id, true); // really deletes the post

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)