How to fix an error message displayed in LiteSpeed Cache


I get the error message "LiteSpeed Cache was unable to write to your wp-config.php file. Please add the following to your wp-config.php file located under your WordPress root directory: define('WP_CACHE', true);" If so, please follow the steps below.

*The cache will not be enabled if the error is displayed.

STEP1: Login to cPanel

Please refer to this article for details.

STEP2: Open File Manager

After logging into cPanel, open File Manager.


STEP3: Open wp-config.php

Open the directory where WordPress is installed (directly under "public_html" for the initial domain), select the file labeled "wp-config.php", and click "Edit" at the top of the screen.


If you get a warning, press the button labeled "Edit".


STEP4: Find the target description

Find the following line at the bottom of the file:

/* That's all there is to editing! Enjoy your blog with WordPress. */

Or it may be written in English like this:

/* That's all, stop editing! Happy blogging.


STEP5: Edit code

Just above that line, write the following code:

define('WP_CACHE', true);


STEP6: Save the file

Press the "Save Changes" button in the upper right to save and close.


Related article

How to speed up with LiteSpeed Cache in WordPress

Was this article helpful?
1 out of 2 found this helpful