How to Properly Update Live Published Posts in WordPress

Have you ever had to make significant edits to an already published WordPress post? Maybe you are rewriting an old article or you have to update screenshots because they're outdated. Since we have to do this on a regular basis on WPBeginner and on our documentations for our suite of products, we have created a workflow that works. In this article, we will show you how to properly update live published posts in WordPress.

How to update live posts in WordPress

The Problem with Updating Live Posts in WordPress

WordPress makes it super easy to create and edit posts. You can edit all posts whenever you want, even after publishing them.

However, when editing live posts, you cannot save them until you are done editing. Saving live posts will immediately make your changes visible.

This is a little problematic for various reasons.

If you're on a multi-author WordPress site someone may need to approve the changes before they go live.

Not to mention, there will be times where you may not be able to finish all changes in one session.

An easy workaround for this issue is to simply copy a post and paste it as a new draft. You can edit the draft and then paste it to the original post.

The problem with this method is that you cannot set or change featured images,Facebook post thumbnailtags or categories, etc. This means that you or an editormust make those changes on a live post.

Well if you run into any of these problems, then this article is good news for you.

We will show you how to properly update live posts while making it possible to save them and make any changes without affecting the live version.

Ready? Let's get started.

Properly Updating Live Posts in WordPress

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

After activating the plugin, you need to visit Posts » All Posts in your WordPress admin. This is where WordPress lists all your published posts and drafts.

All posts

Take your mouse to the post you want to edit and then click on the Revisionize link. This will create a new revision for your published post by cloning the existing post.

Revision of a published post

You can edit the post like you would edit any unpublished draft. You can save your changes as many times as you want without affecting the live post.

You can have your supervisor or editor review the changes for their approval. You can also use public post preview to share it with people outside your organization.

Once you are done editing, you can click on the Publish button. The plugin will then replace your live post with the new version.

What happens to the draft?

It is still stored as a revision draft, allowing you to reuse it again to edit the same published post again.

Revision draft

That's all, we hope this article helped you learn how to properly update live posts in WordPress. You may also want to see these 14 tips for mastering the WordPress visual editor.

How To Display A Message If Javascript Is Turned Off

Having an accessible website is very important it means that you are not neglecting any potential customers coming on to your site and being able to use it correctly.
But what do you do when the visitors comes on your website but hasn't got the browser functionality turned on to use your site. Javascript is one of the main browser features you need to look for and be aware of what to do when this is turned off or turned on. Javascript allows you to do many things on your website from client-side form validation, slide shows, animations and changing HTML elements, there are loads of things you can do. But what if the visitor doesn't have Javascript enabled?
First you need to make sure that your site can work perfectly well without Javascript. Then you need to make sure that all validation is duplicated on both client and server side so you can catch things if Javascript is turned off. If you have something like a slide show which won't do anything if Javascript is turned off you might want to display a message to non-javascript users to say why is isn't working correctly.
The snippet below will display HTML in the browser if Javascript is turned off.
<noscript>
The slideshow is not working correctly because Javascript is turned off.
</noscript>

PHP Debug In Browser Console

When debugging in PHP there are a few techniques you can use, you could use something like Xdebug which will allow you to step through your code at run time and you can see exactly what the code is doing. Xdebug will allow you to step into function and make sure the variables are being set as the should be.
Your other option is to output the code in the browser and exit the script so it just displays what you want to debug and nothing else, something similar to this.

echo '
';
print_r($debug_array);
echo '
';
exit;
?>
This will allow you to see exactly what is in this variable at a certain time of running your code.
But what if you want to view the rest of the page and debug at the sametime, you can simply print the variable without the exit in your code. But then you get the problem of the print being on the page which could either break your design or the debug will be displayed in the design.
Your other option is to write debug into a log file, this can be done with a debug class which writes to a debug log file, allowing you to view all your variables and not breaking your design.
If you don't want to send your data to a log file you can also try this neat little trick and output debug data into the browser debug console.
console
Here is a snippet of a function you can use to output PHP data to the browser console.

/**
 * Send debug code to the Javascript console
 */ 
function debug_to_console($data) {
    if(is_array($data) || is_object($data))
	{
		echo("");
	} else {
		echo("");
	}
}
?>