What can I do on my WordPress site using the Web Terminal?

Procédure

The Web Terminal available on your LWS panel account allows you to perform several actions on the command line. These command lines allow you to interact with your hosting and can, in some cases, help you manage your hosting.

In this documentation, we'll look at how you can use the web terminal to interact with your WordPress site.

Prior to this documentation, we invite you to access your hosting's Web Terminal.

What are the most common WP-Cli commands?

Update WordPress

wp core update

This command is used to update WordPress.

Update all extensions

wp plugin update --all

This command updates all the extensions waiting to be updated.

Check the integrity of WordPress files

wp core verify-checksums

This command is used to check that all the files on your WordPress site have not been modified and remain unaltered in relation to their original version (used to check that a file has not been maliciously modified).

Export the MySQL database

wp db export

This command exports the database in SQL format to your hosting space. Very useful for recovering a data backup with guaranteed reliability.

Import MySQL database

wp db import filename.sql

This command imports the database and can be run in addition to the previous command.

Mass search and replace

wp search-replace 'old-value' 'new-value

This command performs a search and replace in the database of one value by another.

Generate test posts en masse

wp post generate

Clears all WordPress-related caches, useful for performance issues or after major updates.

Empty WordPress caches

wp cache flush

Generates test posts en masse, which is very useful for development and performance testing.

Regenerate thumbnails en masse

wp media regenerate --yes

This command regenerates the additional image sizes for all your media files in your library. No confirmation will be displayed.

Delete all unattached media

wp post delete $(wp post list --post_type='attachment' --format=ids --post_parent=0)

This command begins by listing all the identifiers of attachments without parents and then deletes them permanently. Handy for tidying up sites with lots of media. Use with caution!

Delete all users by role

wp user list --field=ID --role=author | xargs wp user delete --yes

This command deletes all user accounts with the author role. You can change the role by the one of your choice in the role argument and thus carry out a mass deletion of users.

Conclusion

You now know how to :

  • Access the Web Terminal of your LWS hosting.
  • Use WP-CLI commands to update WordPress and your extensions.
  • Check theintegrity of the files on your WordPress site.
  • Exporting and importing your MySQL database.
  • Performing a mass search and replace in your database.
  • Generate testposts and empty WordPress caches.
  • Regenerate thumbnails in your media library.
  • Delete unattachedmedia and users according to their role.

With these powerful commands, you have the power to effectively manage your WordPress site directly from the Terminal, allowing you to maintain a high-performing, up-to-date and secure site. 🚀

Thank you for reading this article! If you have any questions or would like to share your experience with Web Terminal and WP-CLI, please feel free to leave a comment. Your feedback is valuable and can help the whole community! 🙌

Rate this article :

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problÚme technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

1mn reading

How do I connect to the Web Terminal with LWS Panel? (ssh web console)

4mn reading

How can I use GIT with the Web terminal on my LWS shared hosting?

2mn reading

How to change the PHP version of the LWS Panel Web Terminal

0mn reading

How can I use the Web Terminal on my Prestashop site?


Ask the LWS team and its community a question