Most Wanted WordPress Tips, Tricks, and Hacks

WordPress is the most popular CMS platform. We are going to show you the most popular tips, tricks, and hacks for WordPress websites. These tricks are going to make your live easier.

How to use a Custom Homepage

By default, WordPress displays blog posts on the Home page. It’s recommended to use custom page for website front-end.

  1. To do that navigate to Pages > All Pages section in your back-end.

  2. Enter your page title and specify its content. Once a page is ready, click on the Publish button.

  3. You will need to set up this page as a Home page now. Open Settings > Reading page in your admin panel.

  4. Enable A static page (select below) option from the Your homepage displays section and select page you added from the Homepage dropdown.

Deactivate All Plugins when not able to access WP-admin

Do you know the situation when your site is down? The first thing you need to do is plugin deactivation. Your admin panel is locked and you don’t know what to do. Just follow the further steps:

  1. Connect to your server using FTP or hosting cPanel. Open wp-content/plugins directory.

  2. Now just rename plugins folder to plugins_backup. All plugins will be deactivated right away. You can try to access your website now.

Install Google Analytics in WordPress

Google Analytics allows you to gather information about the most popular posts on your website, get info about site visitors. To get this info you need to do 2 simple steps:

  1. Getting Google Analytics code.

  2. Inserting this code to WordPress website.

We recommend that you check our video tutorial on how to install Google Analytics on WordPress to get more details.

Password Protect WordPress Admin Directory

WordPress has a backend where all the changes are performed. That page is password protected by default. Users enter their login details when trying to access the admin panel. But there is one more way to protect your website backend. You can enable wp-admin directory password protection.

  1. Login into your hosting cPanel and locate Password Protect Directories icon under the security section.

  2. You will see popup asking you to select password protected directory. Choose /wp-admin/ directory and specify your username and password.

  3. Try to access your admin panel page now. You should see an authorization box now.

Limit login attempts

You can enter your login details to WordPress unlimited times. It allows to guess your password. To protect your site from hackers we recommend that you limit login attempts for your website.

  1. You can use Login LockDown plugin to do that.

    • Navigate to Plugins > Add New page in your back-end. Enter ‘Login LockDown’ to the search field

    • Install and activate the plugin.

  2. Open Settings > Login LockDown page in your admin panel.

  3. Change core plugin settings:

    • You can change max login retries here. Number of failed login attempts within the “Retry Time Period Restriction” needed to trigger a LockDown.

    • Set up retry time period restriction (minutes). Amount of time that determines the rate at which failed login attempts are allowed before a LockDown occurs.

    • You can decide on how long a particular IP block will be locked out for once a LockDown has been triggered. You can do that under the Lockout Length (minutes).

Remove WordPress Version Number

You can see your WordPress version in the bottom right corner. It’s better to remove WordPress version notification for security reasons.

You can use following PHP code to do that:

function my_remove_version() { return ”; } add_filter(‘the_generator’, ‘my_remove_version’);

Just add those lines to your functions.php file and check the result.

Adding custom CSS to a WordPress Theme

You are going to add custom CSS to customize the appearance and layout of your site. Custom CSS code allows you to adjust colors, font size, paddings, etc.

The best way to add additional CSS is to use an inbuilt customizer. You can do that under Appearance > Customize section in your backed.

Locate Additional CSS tab on the next screen and add the CSS code to the field you will see. Don’t forget to publish your changes.

Use Shortcodes inside Text Widgets

Text widgets don’t allow you to add shortcodes. They can be used for plain text or HTML code only.

To enable shortocodes for the widgets section you need to perform a few simple steps:

  1. Open Appearance > Editor page in your backend.

  2. Locate functions.php file there.

  3. Add following function to that file:

    add_filter(‘widget_text’, ‘do_shortcode’);

  4. Save file by clicking Update file button. That is it! Feel free to add shortcode to text widgets now. You can manage widgets under the Appearance > Widgets page in your backend.

Open Navigation Menu Link in New Window

Do you want to add a custom link to your website menu? But at the same time, you don’t want your site visitors to be redirected out from your website? You can make this custom link open in a new window.

  1. Open Appearance > Menus page in your backend.

  2. Expand menu item that has to be opened in a new window and check if Open link in a new window option is available. The most likely you will not see it. But don’t get upset. You can easily enable it:

    • Click Screen Options tab in top right corner.

    • Check Link Target option under the Show advanced menu properties section.

  3. Now your can scroll down to your menu item. You will see Open link in a new window option available. Check it to make your menu item open in a new link and avoid site redirection.

  4. Save menu and check your site to see the change.

Using Inspect Element Tool to Customize WordPress

“How do I know what CSS code to edit?” – That is the question we hear every day. We will provide you with a short guide on how to find our CSS code to edit.

Almost all browsers have inspect element option. Let’s take a closer look at Chrome Inspector tool.

  1. Open your website and right click with your mouse on the element you want to modify.

  2. Select Inspect option from browser’s menu (or just use Ctrl+Shift+I hotkeys).

  3. You can see new box on your screen now. It contains your page HTML and CSS code. That is what we need.

  4. From the CSS section you can get CSS code to edit.

    You can make the changes here. They will be immediately shown on your screen. But remember! changes will not be saved on your website. You need to add them to CSS files or Additional CSS field (refer to Adding custom CSS to a WordPress Theme section in this tutorial).

We recommend that you check our video tutorial on how to use Google Chrome Web Inspector for more details.

Allow user registration on your WordPress Site

WordPress is very flexible platform. It allows you to add users with different roles. Also, you can enable user registration. So your site visitors will register on your website themselves. A few simple steps have to be done:

  1. Login into your WordPress backend and open Settings > General page from WordPress menu.

  2. Locate Membership section and enable Anyone can register option.

For more details check how to allow user registration on your WordPress site tutorial.

Add Custom Default Gravatar Image

All the comments on WordPress websites have default gravatar image called ‘Mystery Person’. To have some unique image for your blog comments you can upload custom gravatar images.

First of all you need to upload your picture to the website. It can be done under the Media Library section in your backend.

Don’t forget to copy image URL after upload.

Now you can proceed to the next step, gravatar implementation. Open your theme functions.php file (it can be found under Appearance > Editor page in your back-end) and paste following function:

add_filter( ‘avatar_defaults’, ‘wpb_new_gravatar’ ); function wpb_new_gravatar ($avatar_defaults) { $myavatar = ‘’; $avatar_defaults[$myavatar] = “Default Gravatar”; return $avatar_defaults; }

Replace $myavatar value with custom image URL you added earlier.

Visit Settings > Discussions page to see your new gravatar image added there.

Add Images in WordPress Sidebar

That is not an easy task to add image to WordPress sidebar. There is no simple upload image featured available by default. But there is one simple way to add insert image to the sidebar.

  1. First of all you need to upload image to your website. It could be done under the Media Library > Add New section in your back-end. Don’t forget to copy image URL after upload.

  2. Next, go to Appearance > Widgets page. Select Text widget from the widgets available and drop it to the Sidebar position.

  3. Inside this widget you will need to insert HTML code:

    Alternate text

    Where Paste image URL here is your image URL and Alternate text is your alternative text.

  4. Save widget by clicking Save button. Ready! Image is added to sidebar now.

Automatically Close Comments on Old Articles

To protect your posts from getting regular spam content you can disable comments on the old articles. This option is available in WordPress by default. So you can easily turn it off from the Settings > Discuss page in your backend.

Add multiple authors to a WordPress post

WordPress posts are assigned to one author by default. But you can assign it to several authors. The best option is additional Co-Authors Plus plugin installation.

Install plugin following our video tutorial on how to install a WordPress plugin for beginners and configure it:

  1. Now edit post or page where you need to have multiple authors.

  2. Locate Authors section on the post page.

  3. Click on an author to change them. Also you can drag to change their order, click on Remove to remove them.

Add Category Icons in WordPress

Taxonomy Images plugin is a good decision to add category images in WordPress. Install and activate this plugin under the same Plugins > Add New section in your admin panel.

Make sure plugin is enabled for post’s categories. Open Settings > Taxomony Images page. Check Categories option and save the changes.

Visit Posts > Categories page in your WordPress admin panel and click on the add button next to the question mark image. Check your site to see the category image.

How to Display Relative Dates in WordPress

Relative date can give your website visitors understanding of how much time has passed since post is published. To add such setting to your site you need to install and activate Meks Time Ago plugin.

After activation find Meks Time Ago section on Settings > General page on your website.

You can apply “time ago” format and change other settings here.

Update WordPress URLs when Not Able to Access WP-Admin

Do you know the situation when you cannot access site when moving WordPress site to a new domain? Site frontend and backend are not available. Don’t panic! You can update your website URL in functions.php file.

Connect to your server from FTP or hosting cPanel. Open wp-content/themes/your_theme_name folder. Edit and find functions.php file. Add following code to that file:

update_option( ‘siteurl’, ‘’ ); update_option( ‘home’, ‘’ );

Where is correct website URL.

Don’t forget to update URL in your WordPress backend. Open Settings > General page and update WordPress Address and Site Address URLs there.

Changing the Author of a WordPress Post

Decided to change author of the post?

You will need to edit the post where you want to change the author. Authors option is disabled by default. But you can enable it from the Screen Options at the top right corner of the screen.

Now you have Authors box on your post page. Feel free to click on an author to change them.

Submit a ticket