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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: