Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Avoid Accidental Publishing in WordPress

Recently one of our readers asked us how to avoid accidental publishing in WordPress. Even the most experienced bloggers have accidentally hit the publish button. In this article, we will show you how to easily avoid accidental publishing in WordPress.

How to avoid accidental publishing in WordPress

Why Stop Accidental Publishing in WordPress?

Many site owners and bloggers set up automatic processes to share posts on social media and send them to their email list.

Accidental publishing is problematic because your posts can get shared and sent to email subscribers before you get to unpublish them.

If there are some minor errors, then you can just edit a post without unpublishing it.

However, if an incomplete article goes live, then it is a bit embarrassing. Unpublishing the article means your users will see a 404 error when they click on links in their email or social media stream.

Having said that, let’s take a look at how you can easily avoid accidental publishing in WordPress.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

Easily Avoid Accidental Publishing in WordPress

First thing you need to do is install and activate the Publish Confirm plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Once activated, this plugin works out of the box, and there are no settings for you to configure.

Now when you hit the publish button in WordPress, you will see a popup asking if you really want to publish the post.

Confirm publish popup

The plugin works for all posts and pages as well as custom post types.

You can also change the message displayed in the confirmation popup.

You will need to add this code to your theme’s functions.php file or a site-specific plugin.

function custom_confirm_msg() { 

return "You are about to publish this post.\nHave you added a featured image?";



We hope this article helped avoid accidental publishing in WordPress. You may also want to see our guide on how to create a blog post checklist in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

10 CommentsLeave a Reply

  1. Unfortunately I cannot download plugins as I am on That being the case I hardly see how this is of any help to a “beginner”.

    Try giving real assistance to those of us on the .com version of wordpress.

  2. For me the biggest risk is via the WordPress App. When you create a new post in the app, the default state is “publish” so if you save it, you’re publishing it. I always have to remember to manually switch it to draft, then save. I wish they’d make them draft by default!

  3. Hi, I’ve accidentally published a post and changed the status to draft. Should I noindex & nofollow it and what about permalink?

  4. Thank you so much for this! I have only done this once… accidentally published an article that was not ready to go out. Luckily, the WordPress had scheduled it for some time in the far past, instead of “immediate”, so it never got published for anyone to see on the home page. However, my automatic social media feeds that are connected to my site did publish it to the feed. I only discovered this because I get an email when people share their articles on social media, but I had to spend about an hour tracking all the feeds it got published too and deleting the article off the feed. So this will definitely come in handy.

  5. I’ve actually never had this problem myself and just recently discovered the Editorial Calendar which I think will help organize content for the future so I can plan things out, too.

    I like this tip though. You never know, just in case, it’s good to have it there.

  6. I often just create a scheduled date a long time in the future, then remove it when I want to publish

  7. Thanks for the article.

    If I do add the code to functions.php, won’t that be overwritten when a new version of WordPress is released?

  8. Unfortunately, that doesn’t fix the issue for those of us using xmlrpc tools, like Windows Live Writer. I really wish there was a way to build UIs using xmlrpc responses.

Leave a Reply to Eric Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.