Editing WordPress posts using WordPresslib

I’m using the wordpresslib library to make posts to my wordpress website.

I’m trying to now edit older post using the library, but am unsure of where to even start.
Their example does not show how to edit post only how to create basic posts.

Read More

I have been looking around and cant really seem to find anyone posting about wordpresslib. If anyone has any experience with it and could point me in the right direction that would be very helpful!

Related posts

1 comment

  1. After going over the wordpresslib.py file I figured out how to edit previous posts. Anyone that needs to do the same please see the example below:

    include wordpresslib
    
    wp = wordpresslib.WordPressClient(*URL*, *USERNAME*, *PASSWORD*)
    
    lastPost = wp.getLastPost() #access the last post created
    lastPost.description = "edits to be made" #edit the post description
    
    postEdit = wp.editPost(lastPost.id, lastPost, True) #post edit
    

Comments are closed.