Wordpress - jonatello/lab-musing GitHub Wiki

Random troubleshooting notes for Wordpress

SSL Content

If Wordpress is running on Apache behind an Nginx server for reverse SSL termination, it can sometimes cause some images/links to return as HTTP which browsers don't play nice with. There's a plugin that seems to work great to fix this, https://wordpress.org/plugins/ssl-insecure-content-fixer/. Install and Activate the plugin, then navigate to Settings > SSL Insecure Content and set "HTTPS detection to "HTTP_X_FOWARDED_PROTO".

MySQL Notes

To update the site and home URL directly via the database (can also be set via "define" parameter in wp-config.php) log into MySQL, and run the following commands to use the database (assuming it's called "example") and update the 2 options by their name

use example;

update wp_options set option_value = 'https://example.com' where option_name = 'home';

update wp_options set option_value = 'https://example.com' where option_name = 'siteurl';

Update user "jonatello" with new password ""

update 'wp_users' set 'users_pass' = MD5( '<NewPassword>' ) where 'wp_users'.'user_login' = "jonatello";

Create new user "jonatello" with new password "" as an administrator

INSTER INTO 'wp_users' ('user_login', 'user_pass', 'user_nicename', 'user_email', 'user_status') VALUES ('jonatello', MD5('<NewPassword>'), 'firstname lastname', '[email protected]', '0');

INSTER INTO 'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value') VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO 'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value') VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');