WP Update Salts – How To Secure WordPress

If you have ever edited your wp-config.php, you may be familiar with WordPress salt keys. Those are custom strings used to enhance the security of your WordPress installation. Every action that requires some user input is passing through encryptions and those encryptions include a piece of salt in it.

If you want to increase the security of your WordPress installation, it is recommended to update salts in your wp-config.php time to time. In this post, you will learn how to update WordPress Salt keys to increase your website security.


How To Update WordPress Salt Keys

Follow the steps below to update wp salts in your wp-config file:

  1. Open the wp-config.php file using the Cpanel code editor or downloading the file.
  2. Generate new salts using WordPress API tool: https://api.wordpress.org/secret-key/1.1/salt/
  3. Copy and paste new salt keys. Make sure to copy all of the keys generated.
  4. Save and upload the file in place.

If you don’t have access to a code editor or FTP folders, you can also use a plugin like Salt Shaker to do update salt keys in your wp-config file. However, since this is an important edit, I recommend doing it manually.

I hope you enjoyed this tip about updating wp salt keys. Follow our twitter account for more tips on WordPress.

[How To] Remove Block Library CSS from WordPress

Gutenberg editor, that is the default editor for latest WordPress installations, uses special CSS libraries to manage blocks on your site’s frontend. If you are using this new WP editor, it will automatically add this library CSS code on your site;

<link rel='stylesheet' id='wp-block-library-css'  href='https://nextseasontv.com/wp-includes/css/dist/block-library/style.min.css' type='text/css' media='all' />

But, if you are not using Gutenberg blocks in any way, you can use the following snippet to remove this extra stylesheet from your theme;

function wpassist_remove_block_library_css(){
    wp_dequeue_style( 'wp-block-library' );
} 
add_action( 'wp_enqueue_scripts', 'wpassist_remove_block_library_css' );

I know this is only one less request on your server, but if you are aiming for 5000 users a day, it is 150k fewer requests a month 🙂

If you love building up with WordPress, you will love our plugins, too. Check them out here!

SQL Query to Get Posts Using Category Name

select p.id, p.post_title from wp_posts p
inner join wp_term_relationships tr on tr.object_id = p.ID
inner join wp_terms t on tr.term_taxonomy_id = t.term_id
inner join wp_term_taxonomy tt on tt.term_taxonomy_id = t.term_id
where post_status ='publish'
and tt.taxonomy = 'category'
and t.name = 'Renewed'

MySQL Query to List WordPress Posts Using Meta Query

To get a list of WordPress Posts using meta query in MySQL, you can use the following SQL query:

SELECT p.ID, p.post_title, m.meta_id, m.meta_key, m.meta_value FROM `wp_posts` p
LEFT JOIN `wp_postmeta` m ON p.ID = m.post_id
WHERE m.meta_key = 'wpcf-show-status'
AND m.meta_value <> ''  
ORDER BY p.post_title ASC

This query will create a list with ID, post title, meta key and meta value that fits to this WHERE clause. You need to update meta_key and meta_value values before running on your database. Otherwise you will get an empty result set.