How to configure WordPress Database for CentOS 7

Try to disable temporarily SELinux on the web server, with the command: sudo setenforce 0 If the error disappears after disabling SELinux, re-enable it with: sudo setenforce 1 and then allow httpd to connect to a MySql server through the network with: sudo setsebool -P httpd_can_network_connect_db 1 sudo setsebool -P httpd_can_network_connect 1

Most efficient way to trigger wp-cron through system cron.

The official wordpress documentation https://developer.wordpress.org/plugins/cron/hooking-into-the-system-task-scheduler/ suggests doing it via a web request rather as per your first example rather than php CLI as per your second example. Their example uses wget, but your curl request would work just as well. I believe they are using the web request replicates the standard http requests that would … Read more

How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal

I’d love any improvements, or hopefully this helps someone. wp post delete $(wp post list –post_type=”post” –format=ids);wp post delete $(wp post list –post_type=”page” –format=ids);wp plugin delete –all;wp theme delete $(wp theme list –status=inactive –field=name);wp widget delete $(wp widget list sidebar-1 –fields=id);wp widget delete $(wp widget list sidebar-2 –fields=id) edit: added removal of default widgets in … Read more

Problems fixing a REST API 404 after Moving my WordPress Directory and updating Permalink Structure

This sounds like it might be an issue with how the files for the main Apache2 configuration file and those found in the virtual host are written. Adding the following line to the file * /etc/apache2/sites-available/hostname-le-ssl.conf before <Directory /var/www/html/hostname/public_html/> AllowOverride All Then restart apache2. $ sudo systemctl restart apache2 The files in /etc/apache2/sites-available are symlinked … Read more