Delete posts old slugs from database in WordPress

/**
 * Delete posts old slugs from database in WordPress
 */
function delete_old_slugs() {
	global $wpdb;
	$wpdb->get_results( "DELETE FROM wp_postmeta WHERE meta_key = '_wp_old_slug'" );
}
delete_old_slugs();

You can add this snippet to your (child) theme's functions.php file.

No comments yet.

Leave a Reply