Title: Changing slug programatically
Last modified: July 4, 2023

---

# Changing slug programatically

 *  Resolved [martinstrycek](https://wordpress.org/support/users/martinstrycek/)
 * (@martinstrycek)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/changing-slug-programatically/)
 * Hello, is it possible to change slugs of existing posts programatically? I am
   importing aprox. 5000 posts and I need to set custom permalink for each. I tried
   using wp_update_post with custom permalink, but it is saving as default with “-“.
   THanks.

The topic ‘Changing slug programatically’ is closed to new replies.

 * ![](https://ps.w.org/custom-permalinks/assets/icon.svg?rev=1785367)
 * [Custom Permalinks](https://wordpress.org/plugins/custom-permalinks/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-permalinks/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-permalinks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-permalinks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-permalinks/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [martinstrycek](https://wordpress.org/support/users/martinstrycek/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/changing-slug-programatically/)
 * Status: resolved