How to add post_meta ?
Hello Max,
Hope you are fine and everything is ok. Big Thanks for great code.
I am using your code in my WP but struggling to find a way to post meta for my posts. Indeed I am using Yoast SEO plugin and I need a way to be able to fill the content of it in my post. What I need is a way to use post_meta , as yoast_wpseo_focuskw ?
Any idea how the code look like ?
Thank you,
Have you taken a look at the examples in the docs? http://python-wordpress-xmlrpc.readthedocs.org/en/latest/examples/posts.html#custom-post-types contains sample code for deal with post meta fields; even though the title says Custom Post Types, the same technique applies to the standard 'post' and 'page' types as well.
Dear max I can not understand your reply. This topic is also necessary for me. Please help me the way to fill out the seo keyword to Yoast Seo Plugin page post. Any code ideal? Thanks
Have a look at your wp database and you will understand how wp stores meta data and why @maxcutler link to docs is your answer.
Dear n3strom. thank you. I have done it with your suggestion: by follow script: post.custom_fields = [] post.custom_fields.append({ 'key': '_yoast_wpseo_focuskw', 'value': 'ABC' })
Cheers!
Anyway this should be further explained in documentation.
Don't forget to close the ticket!