[Solved] How to make WordPress site load slow (dev purposes)?

  

3
Topic starter

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

1 Answer
2

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));
Share: