WordPress uses transients to manage cache. If you encounter problems with cache pages or the functionality of a plugin, deleting transient data (stored in the website database) can be a solution to the problem.

To delete transients using the WP-CLI command line interface in WordPress, we recommend that you follow the steps below.

 

Delete expired transient data using WP-CLI
 

- Log in to the server via SSH with cPanel user who owns the website for which you want to delete expired transient data.

- Use the cd command to access the root folder of your website eg:

cd public_html/website

Replace public_html/website with the real path to the root folder of your website.

 
Execute the following command:

wp transient delete-expired

The command will return an output similar to:

[email protected] [~/public_html]# wp transient delete-expired Success: 32 expired transients deleted from the database.

 

Deleting all transient data using WP-CLI
 

!Obs Before making changes to the website database, we recommend that you back up the database.

- Log in to the server via SSH with cPanel user who owns the website for which you want to delete expired transient data.

- Use the cd command to access the root folder of your website eg:

cd public_html/website

Replace public_html/website with the real path to the root folder of your website.

 
Execute the following command:

wp transient delete-all

The command will return an output similar to:

[email protected] [~/public_html]# wp transient delete-all Success: 38 transients deleted from the database.

 

For assistance in applying the above instructions on HostX servers please contact us. HostX offers the fastest WordPress hosting and can help you solve your problems.

Cette réponse était-elle pertinente? 0 Utilisateurs l'ont trouvée utile (0 Votes)