By using our mini forum, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy

Q: How to make WordPress site load slow (dev purposes)?

+5 votes

Hi, for development purposes I want my WordPress site to load slow (NOT FASTER!).

How can I do it?

If possible random slow - meaning: one time loading time for 8 seconds, the other time: 20 sec. and so on...

Maybe put some PHP code somewhere?

Thank you

asked in Web Development category by user andrew

1 Answer

+5 votes

Since the first file which loads in WordPress CMS is functions.php you should put just one line of code at the beginning of the functions.php (so it will load the first thing before the other functions and WP files):

Just put sleep() function

To make it load randomly slow just use the rand() PHP function

Here how it will look (in the case below it will load randomly from 8 to 20 seconds):

sleep(rand(8, 20));
answered by user ak47seo