20+ WordPress Hacks for Developers

WordPress Hacks

Over the years WordPress has grown popular and has become a powerful tool for developers, with the help of WordPress you can create a website of your own as well as design, edit or modify it however you please without facing any technical difficulties. WordPress is no exception when it comes to development it is the most popular and user-friendly tool to form a website.

Whether you’re a skilled developer or at the learning stage, no matter if you are a blogger WordPress has extended its reach from regular bloggers to an e-commerce website, it is more than able to give you a solid infrastructure and strong built-in security to your website which cannot be hacked.

Other than that there are many more benefits of using WordPress in building a website but it is important to have certain skills to utilize them, we have listed a few WordPress hacks for the developers to make website designing easy.

Major WordPress Hacks for Developers:

1. Allow Users to Like or Dislike Comments

Allowing the users to like or dislike comments on the website can help you improve the engagement of your website it’s the most trending feature on the websites in 2024. Users can show their support towards comments by liking them or dislike the comment if it was offensive. To add this feature on a website you would have to install software “Comments Like Dislike” to the WordPress admin panel of your website. After activating it visit the comments section and configure the plugins of liking and disliking comments on a page.

2. Allow Users to Submit Posts to Your WordPress Site

Users on a WordPress website can post anything they want by just logging into their accounts, but there can be plenty of visitors on your site that are not registered but are willing to make a post or a comment on it, having to register before making a post might lead them towards leaving the website. You can prevent that from happening by creating a blog post form.

To create a blog post submission form, install the WPForms plugin to the WordPress admin panel of your website. By installing and activating the pro version of the WPForms plugin you can access the post-submission add-on next you can go to WPForms then Add New page and select ‘Blog post submission form’ as your template.

3. Modify The Footer in The WordPress Admin Panel

The footer of the WordPress that comes in the admin field can be changed from ‘Thank you for creating with WordPress’ to anything that you want by writing the code: function remove_footer_admin. You can edit the footer in any style according to your personal preferences.

4. Replace The Login Logo with Your Own

You can change the login logo of the WordPress it can be used for brand awareness purposes; it doesn’t make a huge difference because it is just a small detail. The login logo can be changed from the functions.php file by adding a custom login logo.

5. Resize Images in WordPress

As soon as a particular image is uploaded to the blog WordPress makes multiple copies of it. To alter the measurement of these images in themes or plugins use the code mentioned below in the functions.php file.

Codes:

  • 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

6. Disable Login by Email

Logging in with the emails is the most avoided thing by the developers they often prefer usernames over email addresses for login purposes. Beginners often find it difficult to custom this setting but to customize these settings all you have to do is click on the functions file and write: remove_filter (‘authenticate’, ‘wp_authenticate_email_password’, 20); this will allow you to log in with your username to your WordPress account.

7. Display The Most Recent Update Date of Posted Content

Whenever an article is posted on the website, the word press themes by default show the article’s published date, which is the most essential thing for blogs and websites. But WordPress never shows the date ofthe last update whenever the content is updated, which often becomes a problem because the users wouldn’t know if the data is authentic as per the current date. Thanks to the highly skilled developers that were able to overcome this issue by coding. Codes to display the date of the last update of your posts on a website are as follows.

Codes:

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’ );

8. Display Total Number of Comments in WordPress    

Whether it’s a social website or an e-commerce website comments play an important role to keep the visitors engaged on the website for a longer time, showing the number of comments can make it more interesting for your visitors to participate in the discussions related to your content, it improves the performance of a website and brings more traffic to it.

This is a feature that can be added to your website in WordPress by simply installing the Simple Blog Stats plugin, after the installation activates the software and add [sbs_apoproved] code on the pages or posts you want to show the number of comments in numbers.

9. Hide Ads for Certain Posts

Most websites on the internet make their earnings from the ads sense and traffic on their websites, however, you wouldn’t want to congest your website with the ads, to hide ads from certain posts and articles you can simply go to WordPress and use the code mentioned below to remove the ad.

Code:

  • If(get_the_ID() != xx) {  your ad code here }

XX stands for your post ID

Write the ad code where it’s mentioned.

10. How to Change a Username on WordPress?

You cannot simply change the username of your WordPress account, WordPress allows you to make changes in the name of the user but the username cannot be changed. However, there’s a simple hack to change the username as well. There is a plugin called username changer, by activating this plugin click on the users, in the user’s menu there is a username changer page in the WordPress admin. You can simply select the user name that you wish to change from there.

11. Displaying the Relative Dates in WordPress

Relative dates on the website allow the visitors to acknowledge the age of the content on the website, it also tells them whether they are up to date with the queries they were looking for or not. E.g. of relative dates is (a few seconds ago, one week ago, 3 years ago).

You can this feature by installinga plugin in WordPress“Meks Time Ago”, activate this plugin then choose “Meks Time Ago” from the drop-down menu. From there You can set select how you want to show the time of posts.

12. Enhance the Usability of Your Website’s Navigation

People often visit websites and leave in a few seconds this could be because of multiple reasons but usually, they leave because of the poor navigation system of the website. Your website may have all the answers to their questions or products that they are looking for but your navigation was unable to assist them which resulted in the visitor leaving your website.

Bad navigation on a website can affect your website’s performance and decrease the ratings and affect the SEO. There are multiple techniques to improve your website’s navigation a few of them are:

  • Make your website user-friendly
  • Add menu bars to your website
  • Make the elements of your website clickable
  • Add multiple categories and subcategories

On WordPress, you have access to all the behind-the-scenes and stuff of your website through which you can improve the navigation of your website by adding these features and tools.

13. Insert Title Tags and Alt Text

Your content will look better with pictures, and your site will appear more professional. Images may also be useful behind closed doors. To be more specific, alt texts and title tags can do a great job. If the picture isn’t visible or your site is having difficulties loading images, your readers will see the alt-text to figure out what it’s about. In the meanwhile, title tags aren’t visible, yet they assist with SEO.

before submitting photos add a title tag and alt text. Additionally, both should be brief and include just enough information about the images.

14. Integrate Google Analytics into WordPress

Google Analytics is the best way to monitor your website on WordPress, it is a powerful tool that allows you to see where are the visitors of your website coming from and what kind of visitors are they. You can improve multiple things on the website by using google analytics and bring more traffic to it. Google Analytics is more than able to increase your engagement with the visitors to your website.

Operating Google Analytics on WordPress is simple

The first step is to obtain your Google Analytics tracking code. Select the website for which you require the tracking code in your Google Analytics account and then in the header.php file, paste the tracking code.

15. Restrict Login Attempts

On WordPress websites, the login attempts are unlimited, giving the hackers or the people trying to operate your account and a plus point to enter passwords multiple times until they have guessed the correct password. A plugin called “Login LockDown” can record the IP address and login attempts on the website and block the login requests from that range if a certain number of attempts have been made to a specific account on the website.

16. Reduce The Number of Post-Revisions

You cannot limit post revision on WordPress, since it does not have any limits to it the pages often take more time to load which can result in the visitors leaving your website, it is important to have a limited number of revisions on a website to make it appropriate. To do that just click on the wp-config.php file and add: define( ‘WP_POST_REVISIONS’, 3 ). You can limit the number of revisions on your website.

17. Disable The Default Links of Images in WordPress

WordPress gives you an option to select how you want to link an image when it is uploaded, you either select “None” when you have uploaded an image or you can use a code that automatically selects the image linking to none.

Codes:

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);

18. Remove The Version Number from WordPress

The version of WordPress is mentioned in the header of your WordPress website which can become a liability for you when it comes to the security of a website. It is important to keep the WordPress updated however you can still over this issue by adding codes to the themes function.php in WordPress.

Codes:

function wpbeginner_remove_version() {

return ”;

}

add_filter(‘the_generator’, ‘wpbeginner_remove_version’);

19. Use Rows and Columns to Display Images

In WordPress, images happen to appear on top of one another or together by default which just not looks good to the viewers some people often have to scroll a lot to view the images. This makes your website look like an amateur website to the viewers. To give your website a better look it is important to set the layout of the images according to the content and make sure they don’t jumble up when they are uploaded on the website.

20. Show Total Number of Registered Users in WordPress

On WordPress websites, the login attempts are unlimited, giving the hackers or the people trying to operate your account and a plus point to enter passwords multiple times until they have guessed the correct password. A plugin called “Login LockDown” can record the IP address and login attempts on the website and block the login requests from that range if a certain number of attempts have been made to a specific account on the website.

21. Disable WordPress’s Comment Notification Emails

Automated emails are sent to you every time someone leaves a comment on your website, this seems a bit exciting in the beginning but later becomes frustrating for the developer and you can also miss out the important emails because of these notifications, but in WordPress, you can turn that off by unchecking the ‘Email Me Whenever’ section in your WordPress admin panel.

22. Customizing WordPress Using the Inspect Element Tool

It sounds great to add custom CSS, but how would you know which CSS classes to edit? What’s the best way to debug it without having to write CSS?

You can edit any HTML, CSS, or JavaScript code using the inspect element tool, inspect element is a powerful tool and helps you to preview a website just for yourself without showing it to your audience.

Leave a Comment

Scroll to Top