Connect with us

Wordpress Plugins

Custom WordPress Plugin: How to Auto Publish Deleted Posts After Restoring Them

Have you ever deleted a post by accident only to find out that when you try to restore it, it ends up in your drafts. That is not a problem if you are dealing with one or two posts. If you have deleted hundreds of posts by accident (with a script), that could be time consuming to fix. One easy way to do so is by writing a simple function that checks for untrashed_post action and updates the status to publish.

Currently trending WordPress plugins

You have to be careful with this plugin if you have posts in your trash that shouldn’t be public. This plugin should preserve your original publish date but if you are too worried about that, you can use this approach:

There may be other ways to do things like this but I prefer writing quick scripts that can be deactivated after the job is done.

Continue Reading
You may want to check out:
*some of our articles and lists include affiliate links to fund our operations (e.g. Amazon, Elegant Themes, Envato). Please read our disclaimer on how we fund Exxponent.
You may also like...
Click to comment

More in Wordpress Plugins

To Top