Most Wanted WordPress Tips, Tricks, and Hacks

WordPress has turned out to be a real boon for the bloggers. The simplicity of the platform is the main reason that most of the bloggers love to use WordPress. It features so many plugins that could really save your time in writing bulky and lengthy codes. Whether you want to add an image or some special effects in your website its all easy in WordPress. With a single click, you can increase the readability of your blog. And it’s quite true that readability of your blog is directly proportioned to the active visitors you are going to get on your website. But there are still some basic features of WordPress that are remained unnoticed. Here we bring you up with some amazing most wanted WordPress tips, tricks, and hacks –

most-wanted-wordpress-tips

  • Have you customized your Hompage?

When you set up your WordPress site you may have figured out that the first page or the home page of your website shows the latest blogs or posts of your website. But you can choose whatever page you want as your home page. You just need to follow these steps –

  1. You have to click on Settings under the Admin panel.
  2. Under Settings drop down menu choose Reading.
  3. Under the Reading Settings, you will find Front Page Display option.
  4. Just select the radio button opting for Static Front Page.
  5. Make sure that you have created your home page beforehand.
  6. Choose the page you want to display as your homepage.

You can even customize your homepage with a template. If you know a little PHP you can do it easily.

Just create a template page and add a single code on the top of the file.

<?php /* Template Name: Custom Homepage */?>

After that, you can save it with a particular file name like myTemplate.php and upload it to /wp-content/themes/your-current-theme/ folder using your FTP. Now when you go to your homepage settings under Page Attribute section you will find Template option. Select myTemplate and save it.

  • Have you considered setting up a Password for WordPress Admin Directory?

    WordPress is secure itself but still, you should be cautious about the security of your website. You can make your admin panel super secure by adding an additional layer to you WordPress Admin Directory. You have to follow the steps below-

  1. Login to the cPanel of your hosting service.
  2. Go to the Security section and choose Password Protect Directories.
  3. Now select the directory you want to protect.
  4. Proceed on setup a new username and password for the WordPress directory.
  • How to display Images in a Row or Column?

    You might have noticed that when you add multiple images to any page they look a bit messy. They appear on top of one other which doesn’t look good at all. So you can use a plugin to display them the way you want.

  1. Install Envira Gallery plugin from the admin panel.
  2. Click on Envira Gallery option present on the leftmost taskbar.
  3. Choose Add New option and create your gallery by uploading the images.
  4. Later on, you can customize the number of rows and column format you want the pictures to be displayed.
  5. While creating a new post you can add this gallery by clicking on Add Gallery button on the top.
  • Limiting Login Attempts can be useful

    Limiting Login Attempts can be really useful in adding an extra security barrier to your WordPress Login panel. There are some evil minds who tend to extrude your website and damage your content by trying hit and trial method.  But you can surely prevent this by limiting login attempts. If you want to add this feature you need to –

  1. You have to search Login Lockdown plugin from the dashboard and install it.
  2. Now click on the Login Lockdown plugin under Settings section.
  3. Under the Login Lockdown options, you will find the number of Login attempts that you set as what you want.
  4. There are other options you can configure as well to make it more secure.
  5. Before you leave don’t forget to Update settings.
  • Have you tried adding Default Gravatar Images?

    Whenever you create a new user account in WordPress it sets a default image for the user account. This image is known as a gravatar. if you don’t have your own gravatar then WordPress would use a mystery person instead of your picture as your user account picture. But don’t worry you can create your gravatar image very easily.

  1. First, you need to upload the image you want as your gravatar in the WordPress media library.
  2. Copy the link or URL of the image file.
  3. In the functions.php file you need to add the following code
    add_filter( 'avatar_defaults', 'wpb_new_gravatar' );function wpb_new_gravatar ($avatar_defaults) {$myavatar = 'http://example.com/wp-content/uploads/2017/01/example.png';$avatar_defaults[$myavatar] = "Default Gravatar";return $avatar_defaults;}
  4. Go to Settings and click on Discussions.
  5. You will find your avatar image under avatar images.
  • Modify with your Custom CSS

    If you apply some WordPress theme then it may happen that you don’t like a certain section of the website. You can customize font, color, and style of text and images to be displayed. So you can chance the appearance of your website by adding a custom CSS file to your website.

  1. You have to click on Appearance.
  2. Then choose Customise option.
  3. This would launch the WordPress theme customizer.
  4. Under the Settings panel click on Aditional CSS option.
  5. There you can your custom CSS script in the text block provided.
  6. After you have completed the script you need to Save and Publish before you leave.
  • How to customize certain section of your WordPress website?

    There may be a possibility that you don’t like a certain section of your website theme but you are not able to find which code is affecting that certain section. We have a solution for that.  You can use a special feature known as Inspect Element to know about a specific section of your website.

  1. Just hover over the section of your website you want to edit or customize.
  2. Right-click on it and choose Inspect Element.
  3. Your browser screen will split into three sections.
  4. You have to make changes in the CSS or HTML section.
  5. The changes you make will be directly reflected in the browser.
  6. Just keep in mind that those changes are temporary and you have to make changes in the original CSS files to view it permanently.
  7. But this feature will give you a rough idea that where you need to make changes.
  • Have you tried adding a featured image?

    Whenever you publish an article on your blog the featured image gives your an overview about the article. Moreover when your article is shared on a social media website then featured image is automatically picked as the default thumbnail image. So here is how you can add a featured image to your article-

  1. First, you need to install a WordPress plugin called Yoast SEO.
  2. After you install this plugin then you can click on Add New Post.
  3. When you will scroll down a little bit you will find featured image section on the Right side.
  4. After that, you have to click on Add featured image.
  5. You have to either upload or select an already uploaded image from the media gallery.
  6. Once you select any image it is saved as the featured image of the article.
  • Save your article from Content Scrapers?

    Whenever you publish an article, WordPress shows it the full content of your article through an RSS feed. People can steal your content from here. So you can do certain things to prevent it-

  1. Click on Settings
  2. Go to Reading Page.
  3. You will find For each article in a feed, show.
  4. There you have to choose summary instead of full text.
  • Adding Shortcodes can save your time

If you want to add certain HTML codes to your article you don’t have to write and edit code. You can do easily via an Add Shortcode plugin or edit the functions.php for adding the button in your edit text area.

  1. Open functions.php file and add the following code in it.
  2. add_filter('widget_text''do_shortcode');
  3. Save the file and Update the settings.
  4. When you will write a post then you will automatically find an Add shortcode button in the edit area of the text field.
  • Manipulating RSS to delay article posts

    If often happens either you are a beginner or pro that accidentally you publish an article that is not ready to go online. What happens that before you unpublish it, it already gets emailed as a notification to your subscribers. You can prevent it by manipulating the RSS feeds to delay your posts.

  1. You can open the functions.php file and write following code in it.
  2. function publish_later_on_feed($where) { global $wpdb;
     if ( is_feed() ) { // timestamp in WP-format 
    $now = gmdate('Y-m-d H:i:s'); // value for wait; 
    + device $wait = '10'; // integer // http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff $device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR // 
    add SQL-sytax to default $where $where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait "; } return $where;}add_filter('posts_where', 'publish_later_on_feed');
  3. Save the file and Update the settings.
  4. Now whatever you publish you will have 10 minutes time to unpublish it.
  5. You can also try any site specific plugin.
  • Make link navigation Menu more it interesting 

Have you seen icons or images in the navigation menu? Yes, it makes the overall look of the website a lot better. You can try adding icons or images to your website as well-

  1. You need to install this Menu Image plugin.
  2. Now Go to Appearance and click on Menu.
  3. There would be an option to add images.
  4. Choose the image you like and save it before leaving.
  • Use New Tab while navigation

Sometimes it may happen that there is some important information on your homepage and you don’t want users to get distracted when they click on any navigation menu. So, you set up the links as they open in a new tab.

  1. Go to Settings and click on Menu,
  2. Under Menu page you have to find Screen Options, it will be on the right side.
  3. Then click on Link Target option.
  4. Now you can scroll down to the menu you want to open in a new tab.
  5. Click on Open in a New Tab checkbox.
  6. Click on Save Menu before you leave.
  • Fullscreen Search is really trendy

    WordPress supports site search features by default. But the old way of searching is not much in trend. You can try the full-screen search layout. It is very trendy these days as it provides better search results and never distracts the users.

  1. Go to Plugins section and search Full Page Search.
  2. Or you can visit this page to get the WordPress full page search plugin.
  3. Next, you have to install and activate the plugin.
  4. The WordPress full page search plugin will automatically change your normal search bar to full page search.
  • Have you tried a Sticky Floating Navigation Menu

When you scroll down a page and you need to navigate to some other page from the menu then you have to scroll all the way up to find it. But Sticky Menu always stays at the top of your screen irrespective of your position. It keeps floating and makes your navigation easier. So if your WordPress theme has only a static menu then you can try it out.

  1. Go to Plugins section and search Sticky Menu.
  2. Or you can visit this page to get the Sticky Menu Plugin.
  3. After the installation, you need to activate the plugin.
  4. Then you have to configure the plugin by adding the required CSS class.
  5. Click on Save Menu before you leave.
  • How to Add a Category to WordPress posts

Adding a category to any post can be really helpful for the author as well as the readers of a blog or website. It makes sorting the content published on the website easier. You can add a category to your posts by manipulating functions.php file or activating a site specific plugin like Yoast SEO.

  1. Open functions.php file of your WordPress theme.
  2. Add the following code to it.
  3. // add tag and category support to pages
    function tags_categories_support_all() { register_taxonomy_for_object_type('post_tag', 'page'); 
    register_taxonomy_for_object_type('category', 'page'); }// ensure all tags and categories are included in queries
    function tags_categories_support_query($wp_query) { if ($wp_query->get('tag')) $wp_query->set('post_type', 'any'); 
    if ($wp_query->get('category_name')) $wp_query->set('post_type', 'any');}// tag and category hooksa
    dd_action('init', 'tags_categories_support_all');
    add_action('pre_get_posts', 'tags_categories_support_query');
  4. Save it and Update the settings.
  • How to display the total number of Comments in WordPress?

Comments show the quality and authenticity of your posts. It can be used as a way to earn more trust of your user. It would be quite evident that more no of comments would definitely guarantee better quality discussions.

  1. You can download and install a plugin called Simple Blog Stats.
  2. After you activate the plugin you can insert it anywhere you want.
  3. Whenever you are writing a post you can add it by using a shortcode [sbs_apoproved].
  4. Or you can open functions.php and add the code
  5. function wpb_comment_count() {
    
    $comments_count = wp_count_comments();
    $message = 'There are <strong>'. $comments_count->approved . '</strong> comments posted by our users.';
    
    return $message;
    
    }
    
    add_shortcode('wpb_total_comments','wpb_comment_count'); 
    add_filter('widget_text','do_shortcode');

Now you can use [wpb_total_comments] in your future posts to display the total number of Comments.

  • How to create new image sizes in WordPress?

You may have noticed that whenever you upload an image in the media library, different versions or sizes of images are created automatically. But you can also create your own version of the image by just adding a few lines of code to functions.php file.

  1. Open functions.php file.
  2. Add the following code to it.
  3. add_image_size( 'sidebar-thumb', 120, 120, true ); // Hard Crop Mode
    add_image_size( 'homepage-thumb', 220, 180 ); // Soft Crop Mode
    add_image_size( 'singlepost-thumb', 590, 9999 ); // Unlimited Height Mode

Here you can add the sizes you want. The image will be cropped accordingly.

  • How to display last updated date of your posts?

After publishing an article WordPress shows the publishing date of the article by default. If you update the contents of your article then also the date remains same. Few articles are meant to be always updated otherwise the user may feel that your content is outdated. So you need to renew the date of publishment as well.

  1. Open functions.php file.
  2. Add the following code to it.
  3. function wpb_last_updated_date( $content )
     {$u_time = get_the_time('U');
    $u_modified_time = get_the_modified_time('U');
    if ($u_modified_time >= $u_time + 86400) {$updated_date = get_the_modified_time('F jS, Y');
    $updated_time = get_the_modified_time('h:i a');
    $custom_content .= '<p class="last-updated">Last updated on '. $updated_date . ' at '. $updated_time .'</p>'; } 
    $custom_content .= $content; return $custom_content;}add_filter( 'the_content', 'wpb_last_updated_date' );

    Now save the file and Update the settings.

  • Removing WordPress version number

When you install WordPress on your hosting then by default WordPress shows the version number in the header section of your website. It may be a security concern that if hackers came to know the WordPress version you are using then they can hack into your website. So, removing the WordPress version from your website can be a healthy option.

  1. You have to open functions.php file.
  2. Then add the following code to it.
  3. function wpbeginner_remove_version()
     {return '';}
    add_filter('the_generator', 'wpbeginner_remove_version');
  4. Save the file and Update the settings.
  • How to remove default links in the image?

When you upload an image to the media library, it immediately asks the way you want to link your image. Often you don’t want to link your images so you can do it at once by adding certain code to the functions.php file of the WordPress theme you have applied.

  1. Open functions.php file.
  2. Add the following code to it.
    function wpb_imagelink_setup() { $image_set = get_option( 'image_default_link_type' );
      if ($image_set !== 'none') { update_option('image_default_link_type', 'none'); }}
    add_action('admin_init', 'wpb_imagelink_setup', 10);
  3. When you save the file the image would be by default linked to none.
  • Changing the Excerpt Length

    When you add a new post in your website or blog then WordPress creates a small summary of the whole text. But it may happen that the summary created is not credible enough to explain the context of the whole post.  If you want to increase the length of that small summary or excerpt you can try the following-

  1. You have open functions.php file of the WordPress theme.
  2. Then you have to add the following code to it.
    // Changing excerpt length
    function new_excerpt_length($length) {
    return 100;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    
    // Changing excerpt more
    function new_excerpt_more($more) {
    return '...';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
  3. After that, you need to save the file and update the settings.
  • How to make your Copyright date dynamic?

    Putting a copyright on your Website is a must in order to claim the authenticity of your content. But whenever you add a copyright year you have to change it every year manually in order to keep your site updated. But if you want to avoid all such things you can add a dynamic copyright to your website which changes automatically according to the current year or date. You can apply this to your website or blog by-

  1. Open the footer option in the Customise theme section.
  2. There you need to find or edit custom code feature.
  3. Then in the copyright section, you have to add the following code
    &copy; 2009 – <?php echo date('Y'); ?> ExampleBlog.com
  4. You have to save the settings before you leave.
  • How to change Sender Name in outgoing email notifications?

If the readers have subscribed for email notifications for the latest post published on your website or blog then in the email, WordPress uses “WordPress” as the default sender’s name. It does not look good at all and totally unprofessional. But you can edit the sender’s name by adding certain code to the functions.php file.

  1. Open functions.php file from the theme of the WordPress.
  2. Next, you need to add the following code to it.
    // Function to change email address
    
    function wpb_sender_email( $original_email_address ) {
     return '[email protected]';
    }
    
    // Function to change sender name
    function wpb_sender_name( $original_email_from ) {
     return 'yourName';
    }
    
    // Hooking up our functions to WordPress filters 
    add_filter( 'wp_mail_from', 'wpb_sender_email' );
    add_filter( 'wp_mail_from_name', 'wpb_sender_name' );
  3. Then you have to save the file and Update the settings.
  • Handling Long Articles

Sometimes it may happen that the article you publish is a bit lengthy. So when you publish it the format and theme of your website does not look good at all. It all looks messy and clumsy. Even it can affect the readers as they may find the article cumbersome to read. So you can split your lengthy article into multiple pages for better orientation.

Whenever you are drafting an article you can insert the code <!––nextpage––> in it where you want to end the page.

We have brought up these most wanted WordPress tips, tricks, and hacks. Hope this article serves your purpose and you would use these  WordPress tips, tricks, and hacks to boost up your future articles or blog posts.

Leave a Reply