March 10, 2023
Share

How to auto publish draft post in wordpress without plugin

Hello friends, instead of publishing the content you have added in bulk, how can we publish the content you have saved as a draft independently from wordpress? I will tell you this.

How to automatically publish WordPress drafts?

To automatically publish drafts in WordPress; Follow the items below.

  • First, we connect to the ftp folder of our WordPress site.
  • We go to the home directory where WordPress is installed.
  • We create a php file called cron.php.
  • Click on the link and copy the codes opened on the page.
  • Let’s save the copied codes into our cron.php file.
  • Go to the Cron Jobs menu from your hosting control panel.
  • Create a new cronjob and set the time interval for your posts to be published.
  • Edit and add the code on the bottom line to the command field according to your site.
  • wget -q –spider https://yourblog.com/cron.php?run=112 > /dev/null 2>&1

  • Your sample cronjob code will look like the bottom line:
  • 0 */3 * * * wget -q –spider https://yourblog.com/cron.php?run=112 > /dev/null 2>&1

The sample code view is set to run every 3 hours and update 1 draft post each time as published.
This article is for publishing drafts without using scheduled tasks. If you need help, you can write to us in the comments. If your need is met, you can like and share the article so that others can see it.

You may also like