Tag: WordPress

No Update Required - Your WordPress database is already up to date!

How to Fix: No Update Required: Your WordPress database is already up to date!

I was recently updating WordPress for a client and this message popped up. I could no longer access wp-admin and was locked out permanently! In this article I will go through the steps that solved the issue for me.

Introduction This issue appears to be related to caching, in my case the W3 Total Cache plugin and the file object-cache.php located in the /wp-content folder. If you update WordPress without disabling W3 Total Cache first, in some situations you may get locked out of /wp-admin and see “No Update Required: Your WordPress database is…

Continue reading How to Fix: No Update Required: Your WordPress database is already up to date!

How to Override Yoast Meta Description

You can use wpseo_metadesc to have your own custom meta description. Just paste the following into functions.php. // custom meta description function filter_wpseo_metadesc( $wpseo_replace_vars ) { return “your custom meta desc here!”; }; // add the filter add_filter( ‘wpseo_metadesc’, ‘filter_wpseo_metadesc’, 10, 1 );

Continue reading How to Override Yoast Meta Description

WordPress: Unable to create directory wp-content/uploads/. Is its parent directory writable by the server?

If you see one of the following errors relating to the uploads folder: Unable to create directory wp-content/uploads/. Is its parent directory writable by the server? The uploaded file could not be moved to wp-content/uploads/ This may indicate a permissions problem with your WordPress uploads directory. If you don’t have shell access to your web server…

Continue reading WordPress: Unable to create directory wp-content/uploads/. Is its parent directory writable by the server?

Getting a 404 After Moving WordPress to Nginx

You will need to edit the config file to instruct Nginx to direct requests to index.php. Open your config file. The default location is /etc/nginx/sites-enabled/default, however, if you followed an earlier guide setting up multiple domains in Nginx, your config may be located in /etc/nginx/sites-enabled/example.com. sudo nano /etc/nginx/sites-enabled/default Scroll down to the location / block.…

Continue reading Getting a 404 After Moving WordPress to Nginx

WordPress: Add custom class name to body for a particular template

To add a custom CSS class to the <body> tag in WordPress, add the following to functions.php. In the following example, we are adding the class my_custom_class to the template my_template.php and my_other_class to the template my_other_template.php. function my_custom_classes( $classes ) { if ( is_page_template( ‘my_template.php’ ) ) { $classes[] = ‘my_custom_class’; } if (…

Continue reading WordPress: Add custom class name to body for a particular template

Nginx: 502 Bad Gateway / xmlrpc.php. Is your site under attack?

I recently found my web server unresponsive with a “502 Bad Gateway”. The Ubuntu process viewer revealed the php-fpm service running at 100% CPU. On further investigation, the Nginx access log showed thousands of entries for xmlrpc.php from multiple IP addresses and spoofed user agents, one purporting to be Google Bot. /var/log/nginx/access.log 151.115.xx.xx – -…

Continue reading Nginx: 502 Bad Gateway / xmlrpc.php. Is your site under attack?

WordPress: Add custom CSS to admin pages and login page

You can add custom CSS to all admin pages by adding this function to functions.php (located in your theme’s subdirectory in wp-content/themes). functions.php function admin_css() { ?> <style type=”text/css”> h1 { color: red; } </style> <?php } add_action(‘admin_head’, ‘admin_css’); To add custom CSS to the WordPress login page, add the following to functions.php. This CSS…

Continue reading WordPress: Add custom CSS to admin pages and login page