WhatsApp Monthly Document Scheduler
Automatically sends documents to customers via WhatsApp every month at a scheduled time.
by Kartik M Prajapati · github.com/kartikmprajapati/whatsapp-wordpress-plugin-
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kartikmprajapati/whatsapp-wordpress-plugin-/archive/refs/heads/main.zipReadme
Automatic Message Scheduling
This plugin uses WordPress Cron (WP-Cron) together with the server's real Cron Job to send WhatsApp messages automatically without requiring a user to refresh or visit a page.
How It Works
Server Cron Job
↓
wp-cron.php
↓
WordPress checks scheduled events
↓
Plugin Cron Hook
↓
WhatsApp Message Function
↓
Meta WhatsApp Cloud API
↓
Message Sent
Production Setup
1. Upload the Plugin
Upload the plugin to:
wp-content/plugins/whatsapp_report_sent/
Make sure all Composer dependencies are available, including the vendor directory if required.
2. Configure the Plugin
Configure the required WhatsApp API credentials:
- WhatsApp Business Account ID
- Phone Number ID
- Access Token
Do not commit API credentials or secrets to GitHub.
3. Schedule the WordPress Cron Event
The plugin registers a WordPress scheduled event and connects it to the message-sending function.
Example:
add_action('my_whatsapp_cron', 'send_whatsapp_message');
function send_whatsapp_message() {
// Check database for messages that are due
// Generate PDF if required
// Send WhatsApp message using Meta WhatsApp Cloud API
// Update message status
}
4. Disable WordPress Page-Load Cron
Add the following line to wp-config.php:
define('DISABLE_WP_CRON', true);
Place it before:
/ That's all, stop editing! Happy publishing. /
This prevents WordPress from depending on website visits to trigger scheduled events.
5. Create a Real Server Cron Job
Create a Cron Job through your hosting control panel or server.
Run the Cron Job every first day of next month on time 10:00:00:
The Cron Job should execute:
https://yourdomain.com/wp-cron.php
For example, using wget:
wget --delete-after https://yourdomain.com/wp-cron.php
6. Verify the Cron Job
The server Cron Job should periodically call:
https://yourdomain.com/wp-cron.php
WordPress will then check whether any scheduled events are due.
If the plugin's event is due, WordPress executes the registered plugin hook.
7. Verify the Plugin Function
The execution flow should be:
Real Server Cron
↓
wp-cron.php
↓
my_whatsapp_cron
↓
send_whatsapp_message()
↓
Meta WhatsApp Cloud API
The user does not need to refresh or visit the website.
Logging
The plugin maintains its own app.log file for logging.
The log can be used to verify whether the scheduled function was executed and to identify errors from the WhatsApp API.
Example:
2026-08-13 10:00:00 - WhatsApp cron executed
2026-08-13 10:00:02 - Error : <Some API error>
Also verify:
- Server Cron Job is enabled.
- `wp-cron.php` is accessible.
- The plugin is activated.
- The scheduled event exists.
- The scheduled event is due.
- WhatsApp API credentials are valid.
- Database records contain the expected scheduled time.
- Message status is updated after sending.
### Important Notes
The server Cron Job is responsible for **triggering `wp-cron.php`**.
`wp-cron.php` does not directly call the WhatsApp API. WordPress checks its scheduled events and executes the plugin's registered Cron hook when the event is due.
Therefore, the complete process is:
```text
Server Cron
↓
wp-cron.php
↓
WordPress Cron
↓
Plugin Cron Hook
↓
Plugin Function
↓
WhatsApp API
This allows messages to be sent automatically even when no user is visiting the website.