• Hello, I simply want to change the title and permalink of a post that I know the ID of. I’m thinking something like this

    $post = get_post($id);
    $post->title = 'my title';
    $post->permalink = 'my-title';
    $post->save();

    These probably aren’t real properties or methods so, what do I need to do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Why would you want to do this? Why not just go in your wordPress admin and change the post title?

    Thread Starter farzher

    (@farzher)

    Because I need a custom feature where the title is a combination of custom field values. And that should be behind the scenes/automatic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to edit posts information in the database?’ is closed to new replies.