Title: Setting post status in JS
Last modified: January 14, 2020

---

# Setting post status in JS

 *  [theMikeD](https://wordpress.org/support/users/themiked/)
 * (@themiked)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/setting-post-status-in-js/)
 * Is there a way to set the post status using JS?
 * I have found [updatePost](https://developer.wordpress.org/block-editor/data/data-core-editor/#updatePost)
   but there are no examples of it being used in practice that I can find anywhere,
   let alone in the official docs.
 * Basically I want to set the post status to ‘draft’ in JS under certain circumstances.
   Is this possible?
 * If more context is needed I can provide it but I’m trying to keep it simple for
   now 🙂

The topic ‘Setting post status in JS’ is closed to new replies.

 * ![](https://ps.w.org/gutenberg/assets/icon-256x256.jpg?rev=1776042)
 * [Gutenberg](https://wordpress.org/plugins/gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenberg/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [theMikeD](https://wordpress.org/support/users/themiked/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/setting-post-status-in-js/)
 * Status: not resolved