If you are running Multiple WordPress Sites on a HostGator Shared Hosting Account (or even BlueHost since they are under the same management)… there is something that you need to take note and take immediate action if possible if you do not wish to have your sites being taken down (a 500 Internal Server Error)!
This has something to do with WordPress Cron Job (there’s this file called wp-cron.php within your WordPress Installation) and how it loads up the CPU Processing in your Shared Servers in the background! Read on to understand what happened and what you can do!
All My WordPress Sites Were Taken Down Because Of WordPress Cron Job
In simple terms of what WordPress Cron Job does behind the scene… this is like a brain behind your WordPress site which gets to work whenever your site is being loaded either due to a visitor landing on your site or when you are performing your editing tasks in your Admin Panel
And on top of that, if you have those WordPress Plugins that do a lot of Information Extraction, for example, those Plugins that pull out and display Related Posts and Popular Posts on your sites… these also tend to add on to the processing behind WordPress Cron Job which in turn affects the CPU Loading!
What you must take note is that HostGator doesn’t really inform you that your sites are having such an issue – they will usually monitor from their backend for quite a while and once there’s a spike they will take down your site.
It is only upon your Support Request that they will reveal to you that there’s issues with your sites!
If this is making you think twice about getting a Hosting Account with HostGator… I would just say that almost every Hosting Company that has a Shared Hosting Package will do the same thing (providing no early warning notice) to protect the interests of every hosting customers. I will still recommend that you go for HostGator (use this Coupon Code IGETHOST25 to get 25% off) if you are looking for a strong customer service support and easily affordable package for any WordPress Hosting services!
If you cannot afford such form of disturbances… go for more premium hosting accounts provided by WPEngine.com or a VPS / Dedicated Account.
What You Can Do To Resolve The Issues Caused By WordPress Cron Job?
The way to resolve this issue is to disable WP-CRON.PHP through your WP-CONFIG.PHP file and to set up a Cron Job within your HostGator cPanel Account.
The required steps are listed at here: How to Replace WordPress Cron with a Real Cron Job
Actual Steps Required Are:
1) Log In To Your cPanel Account (usually yourmaindomain.com/cpanel)
2) Look Under Files > File Manager > Search For Your WP-CONFIG.PHP file
Change the Permission to 0644 if you are see that the settings is at 0444. Remember to change it back to 0444 Permissions after you have edited it.
3) Do a backup of this file in case you do up an error and after that include this Line define( ‘DISABLE_WP_CRON’, true); to the second line (after the <?php )
4) Repeat this Step if you have multiple WordPress sites
5) Go back to your cPanel Account and look for Cron Jobs under the Advanced Section
Once you are in it, these are the kind of settings you will need:
You will have to choose a Common Settings like “Every 15 Minutes” and the Minute Field will auto-populate. 15 minutes is the recommended time for your Cron Job.
After which you will copy this line “wget -q -O – http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1″ under the Command Field. Remember to change the yourwebsite to your own Domain Name.
Once you are done with that, just click on the “Add New Cron Job” and you are done with your first site.
For Subsequent Sites, repeat the above steps but changing the minute by adding another 5 minutes to it which means your */15 will look like */20. Keep adding 5 minutes for each subsequent site. At this stage, you will also need to know which are your busier sites and those are heavily visited, set them up as the first few.
This New Setup will replace what your usual WordPress Cron Job does and has more positive impact on your Hosting CPU as well.
So if you do have multiple WordPress Sites on those Shared Hosting Account… get this done today and save yourself from having your sites being taken down!
I hope this has been useful to you!