Placez ce code dans functions.php de votre thème actuel wp:
1 2 3 4 5 6 7 8 9 10 | <?php $args = array('post_type' => 'WRITE-OLD-SLUG-HERE', 'numberposts' => -1); $posts = get_posts($args); if (!empty($posts)) { global $wpdb; foreach ($posts as $key => $post) { $wpdb->query("UPDATE {$wpdb->posts} SET post_type = 'WRITE-NEW-SLUG-HERE' WHERE ID = {$post->ID}"); } } ?> |
Remplace tout ÉCRIVEZ-VIEUX-SLUG-ICI et ÉCRIVEZ-NOUVEAU-SLUG-ICI aux slugs dont vous avez besoin puis actualisez la page d'accueil de votre site. Après l'actualisation de la page, supprimez le script du fichier functions.php.
C'est tout.