WordPress, can’t update post_name

According to the docs this should work

$my_post = array(
  'ID'           => 12345,
  'post_title'   => 'This is the new post title.',
  'post_name' => 'and-this-the-new-name',
);

wp_update_post( $my_post );

But it does not. The title is changed, but not the name.

I deactivated every plugin. I am running the most current WordPress version.

Read more here: WordPress, can’t update post_name

Leave a Reply

Your email address will not be published. Required fields are marked *