Title: reset permalink for all custom type posts
Last modified: August 21, 2016

---

# reset permalink for all custom type posts

 *  [Bazan](https://wordpress.org/support/users/bazan/)
 * (@bazan)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/reset-permalink-for-all-custom-type-posts/)
 * Hi,
 * I want to delete a permalink for all posts of my CPT. It should just work like
   default when u delete permalink and let WP generate new one.
 * My client duplicated posts, and forgot to change permalink, now there is about
   150 products with wrong permalink.
 * The function will be runned only once.
 * I want something like this:
 *     ```
       function reset_permalinks(){
         $posts = get_all_cpt_posts('cpt_name');
   
        foreach ($posts as $post) {
   
           reset_permalink($post);
   
         }
   
       }
       ```
   
 * What is the wp function to reset permalink? I mean, what function WP use when
   u set permalink to empty and save a post – then its generated – i need this function
   🙂

The topic ‘reset permalink for all custom type posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Bazan](https://wordpress.org/support/users/bazan/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/reset-permalink-for-all-custom-type-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
