Title: get_delete_post_link not working
Last modified: April 19, 2017

---

# get_delete_post_link not working

 *  [danktv](https://wordpress.org/support/users/danktv/)
 * (@danktv)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get_delete_post_link-not-working/)
 * Hi,
    I simply would like to add an option for users to delete their own posts
   on my website. The porblem is : the text and the confirmation box shows up, it
   takes the user back to the homepage but Nothing happenned, the post is still 
   there. Could someone help me ?
 * Here’s the “single.php” of my theme with my code in it:
    <!– <?php get_header();?
   >
 * <?php get_sidebar(); ?>
 * <?php hu_get_content( ‘tmpl/single-tmpl’); ?>
 * <?php if ($post->post_author == $current_user->ID) { ?>
       <p>ID ); ?>”>Delete
   post
   </p>
    <?php } ?>
 * <?php get_footer(); ?> */
    –>

Viewing 1 replies (of 1 total)

 *  Thread Starter [danktv](https://wordpress.org/support/users/danktv/)
 * (@danktv)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get_delete_post_link-not-working/#post-9045388)
 *     ```
       <?php get_header(); ?>
   
       <?php get_sidebar(); ?>
   
       <?php hu_get_content( 'tmpl/single-tmpl'); ?>
   
       <?php if ($post->post_author == $current_user->ID) { ?>
          <p><a onclick="return confirm('Are you SURE you want to delete this post?')" href="<?php echo get_delete_post_link( $post->ID ); ?>">Delete post</a></p>
       <?php } ?>
   
       <?php get_footer(); ?> */
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘get_delete_post_link not working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [danktv](https://wordpress.org/support/users/danktv/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/get_delete_post_link-not-working/#post-9045388)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
