Wordpress Snippets
Disable Wordpress default login url and set a custom one
How to disable the default Wordpress urls, /wp-admin and /wp-login</em...
Redirect Wordpress default login url to a custom page
In WordPress, you can use the login_init action hook along with the <str...
Redirect Wordpress default registration url to a custom page
In WordPress, you can use the login_init action hook along with the wp_redirect...
Redirect 404 pages to the home
Create a custom WordPress function to redirect 404 pages to the home page by adding the following code to your theme'...
Wrapping embedded images with an image-container class in all posts
We can use jQuery to wrap the images under the specified class with a div having the class image-container. Here's a...
How block visitors from a certain country in Wordpress
You can use custom code added to your theme's functions.php file to achieve country blockin...
Disable the Comment section under posts in WordPress
To disable the comment section under posts in WordPress using the functions.php file, you can use th...
To add something to the WordPress head section using the functions.php
To add something to the WordPress head section using the functions.php file, you can utilize the wp_head action hook....
Password protect an entire WordPress website using the functions.php file
To password protect an entire WordPress website using the functions.php file, you can add a code snippet that prompts...
Creating new Wordpress admin user with functions.php
This WordPress function can be used to register a new admin user in the WordPress database: </...