I think that is the wrong way. What you might consider to to is to create an wp_schedule_event
and then run http://www.abc.de/wp-cron.php
per cPanel-Cron, that should work and will be a better way in the “idea” of WordPress.
-Edit-
Create an cron.php
(or whatever you would like to call that file) in you plugin. Than from the main php file include that cron.php file.
if (wp_next_scheduled('myActionRunCron') === FALSE) {
wp_schedule_event(time(), 'hourly', 'myActionRunCron');
}
And then register an Action-Handler to that Action myActionRunCron
add_action(
'myActionRunCron',
'myCronAction'
);
And in the cron.php
-File, place an function named myCronAction. Thats it.
function myCronAction() {
// do some stuff
}
Than this Action will be run through WP each Hour. You can modify that by modify the wp_schedule_event
-Call.
How to configure the Cronjob in cPanel could be found here on Hostgator
Related Posts:
- integrating external php library into wordpress- the right way
- Running WP Cron on multisite the right way
- Include WP_Query in my own PHP file?
- Include a external PHP file into a WordPress Custom Template
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- Include files in functions.php
- load/require specific php files for specific pages/templates/post types
- What would be a PHP command to erase all posts from category X from the last month?
- How To Make Connection To WordPress Data Base In A Plugin?
- Initialize WordPress environment to use in a real cron script
- ob_get_clean returns empty string, ob_get_flush outputs string
- Renaming wp-content folder dynamically
- Multiple wp_schedule_event cron jobs in plugin cause multi-execution
- Run W3 Total Cache Flush Function with Crontab [closed]
- Fix 403 error on WordPress multisite network using subdomains
- Make WordPress upload directory outside wordpress root with custom url
- Notice: Constant already defined in wp-config.php on (non-existent) line?
- where to include a php file
- No wp-config.php file on local install of wordpress – site still displays
- How can I change WordPress domain from remote to localhost?
- Why am I getting ERR_NAME_NOT_RESOLVED when I add a site to my multisite installation? [closed]
- Include Class File in WordPress
- nowplaying.include.php Will Not Display Results
- Change title and meta description in included page (not template)
- Can I change a variable in a content part while calling it?
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- the_author() not working outside the loop
- When did wordpress switched requirements to php7?
- How to get woocommerce cart content without an action?
- WP_cron won’t trigger my action
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Put CSS inside a PHP file and include it the right way
- Force SSL using FORCE_SSL_ADMIN
- How can I resolve the php notice “Constant EMPTY_TRASH_DAYS already defined”
- functions.php is being included twice, creating PHP fatal errors
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- PHP help get_template_directory + PHP include
- export a csv file from the database with a cronjob
- code is skipping a div
- How to bypass maintenance mode with external cron?
- Is it possible to increase php memory without directives in wp-config.php, .htaccess or php.ini?
- How wp-cron can run in background if PHP is single threaded?
- WP Cron job timeout issues
- running wp-cron.php using php not wget
- Why does abstracting html from plugin code result in loss of access to wordpress functions?
- PHP include is only working in certain places in my custom WP theme
- Correct and safe way to include php content in my page
- How to add API security keys into JS of wordpress securely
- What is the proper way to include a PHP framework into my theme?
- Moving wordpress site from localhost to live server using GoDaddy cPanel
- What is the difference in the WP memory limits?
- php include not working in custom page
- Post’s ID pattern?
- Using WP functions such as the_title() in an included php file
- What’s the best way to include PHP code in pages?
- Large WordPress CRON job
- Set site title & tagline with wp.config or function.php
- How to Schedule Cronjobs for start of every month and year
- How to include custom PHP file both in header and footer files
- WordPress cron is running with previously set time intervals and not the updated one
- Include a file that has a function in it
- How to decrease the max file upload size without using php.ini or htaccess?
- How do I call an external php non WordPress class into functions.php?
- Unzip file in functions.php, and add it to cron
- Can/should we delete wordpress cron jobs with no action?
- Wp_Schedule_Event every few minutes doesn’t work
- Setting up a cron job to auto update a custom field
- How can I redefine WordPress wp-content directory programmatically?
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Site cannot access external connection
- CRON job to update wp_usermeta value each day or week based on server time
- Before & After Content – After Content directly below Before Content when using require_once
- Cron not sending wp-mail()
- Php cron job (wp-cron) not working
- New database entry to trigger runing PHP/SQL query through link with token, without logging into the website
- loading a php file to a specific page id
- Serve cookie free URLs in WordPress without using a CDN
- How do I fetch a data from an external database into my wordpress homepage
- How do I fetch a data from an external database into my wordpress homepage
- Local WordPress from Git repo, where to set document root?
- PHP get_category() function redeclared
- I changed the password for the database user of my website, updated wp-config.php and wordpress asks to be reinstalled
- Resource 404 error on multisite subdirectory install
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- Include a php file that is above WP installation hierarchically?
- How can I include a file related to blog URL? Nothing seems to work
- Cron job to call php to email last 24 hours posts
- WordPress blog set up
- How does one programmatically manage posts from a external php script?
- Shortcode not passing variable to included file
- php “use” not working in template [closed]
- How to include a php file in every post and page [duplicate]
- Shortcode to include PHP file, pass various parameters to include?
- WordPress White Screen Error
- PHP 7.3 is required for WordPress 5.2 or Recommendation
- Difference between php memory limit and wp memory limit?
- Detecting charcater encoding for wp-config.php file
- Changing WP_MEMORY_LIMIT doesn’t affect actual memory limit
- Should I use include(_once) or require(_once) for loading php-file with customizer settings?
- Removing the add to cart button from specific product pages