Categories
Website

How to Easily Optimize Images for Web (without Losing Quality)

Did you know that optimizing your images before uploading to WordPress can have a huge impact on your website speed?

When starting a new blog, many beginners simply upload images without optimizing them for web. These large image files make your website slower.

You can fix this by using image optimization best practices as part of your regular blogging routine.

In this article, we will show you how to optimize your images for faster web performance without losing quality. We will also share automatic image optimization plugins for WordPress that can make your life easy.

How to Optimize Your Images in WordPress (Step by Step)

Since this is a comprehensive guide on image optimization for web, we have created an easy to follow table of content:

What is Image Optimization? (Optimized vs Unoptimized Images)

Image optimization is a process of saving and delivering images in the smallest possible file size without reducing the overall image quality.

While the process sounds complex, it’s actually quite easy these days. You can use one of the many image optimization plugins and tools to automatically compress images by up to 80% without any visible loss in image quality.

Here’s an example of optimized vs unoptimized image:

Optimized vs Unoptimized Images in WordPress

As you can see, when optimized properly the same image can be 75% smaller than the original without any loss in quality.

How does Image Optimization work?

In simple terms, image optimization work by using compression technology like “Lossy” and “Lossless” which helps reduce the overall file size without any noticeable loss of quality.

What does it mean to Optimize Images?

If you ever received a recommendation to optimize images by your WordPress hosting support or by a speed test tool, then all it means is that you need to reduce the file size of your images by optimizing them for web.

Why is Image Optimization Important? What are the Benefits of Image Optimization?

While there are many benefits of optimizing your images, below are the top ones that you should know:

  • Faster website speed
  • Improved SEO rankings
  • Higher overall conversion rate for sales and leads
  • Less storage and bandwidth (which can reduce hosting and CDN cost)
  • Faster website backups (also reduces cost of backup storage)

Outside of video, images are the next heaviest item on a web page. According to HTTP archive, images make up on average 21% of a total webpage’s weight.

Since we know fast websites rank higher in search engines (SEO) and have better conversions, image optimization is something that every business website must do if they want to succeed online.

Now you might be wondering how big of a difference can image optimization really make?

According to a Strangeloop study, a one-second delay in website load time can cost you 7% of sales, 11% fewer pageviews, and 16% decrease in customer satisfaction.

How speed affects your website

If these aren’t enough reasons to speed up your website, then you should know that search engines like Google also give preferential SEO treatment to faster loading websites.

This means that by optimizing your images for web, you can both improve website speed and boost WordPress SEO rankings.

How to Save and Optimize Images for Web Performance?

The key to successful image optimization for web performance is to find the perfect balance between lowest file size and acceptable image quality.

The three things that play a huge role in image optimization are:

  • Image file format (JPEG vs PNG vs GIF)
  • Compression (Higher compression = smaller file size)
  • Image Dimensions (height and width)

By choosing the right combination of the three, you can reduce your image size by up to 80%.

Let’s take a look at each of these in more details.

1. Image File Format

For most website owners, the only three image file formats that really matter are JPEG, PNG, and GIF. Choosing the right file type plays an important role in image optimization.

To keep things simple, you want to use JPEGs for photos or images with lots of colors, PNGs for simple images or when you need transparent images, and GIF for animated images only.

For those who don’t know the difference between each file type, PNG image format is uncompressed which means it is a higher quality image. The downside is that file sizes are much larger.

On the other hand, JPEG is a compressed file format which slightly reduces image quality in order to provide a significantly smaller file size.

Whereas GIF only uses 256 colors along with lossless compression which makes it the best choice for animated images.

On WPBeginner, we use all three image formats based on the type of image.

2. Compression

The next thing is image compression which plays a huge role in image optimization.

There are different types and levels of image compression available. The settings for each will vary depending on the image compression tool you use.

Most image editing tools like Adobe Photoshop, On1 Photo, GIMP, Affinity Photo, and others come with built-in image compression features.

You can also save images normally and then use a web tool like TinyPNG or JPEG Mini for easier image compression.

Although it’s a bit manual, these two methods allow you to compress images before uploading them to WordPress, and this is what we do on WPBeginner.

There are also several popular WordPress plugins like Optimole, EWWW Image Optimizer, and others that can automatically compress images when you first upload them. Many beginners and even large corporations prefer to use these image optimization plugins because it’s easy and convenient.

We will share more about these WordPress plugins later in the article.

3. Image Dimensions

Normally, when you import a photo from your phone or a digital camera, it has a very high resolution and large file dimensions (height and width).

Typically, these photos have a resolution of 300 DPI and dimensions starting from 2000 pixels and more. These high-quality photos are well-suited for print or desktop publishing. They are not suitable for websites.

Reducing file dimensions to something more reasonable can significantly decrease image file size. You can simply resize images using an image editing software on your computer.

For example, we optimized a photo with 1.8 MB original file size, 300 DPI resolution, and image dimensions of 4900×3200 pixels.

We chose jpeg format for higher compression and changed dimensions to 1200×795 pixels, and it reduced the image file size to 103 KB. That’s 94% less than the original file size.

Now that you know the three important factors in image optimization, let’s take a look at various image optimization tools for website owners.

Best Image Optimization Tools and Programs

As we mentioned earlier, most image editing software come with image optimization and compression settings.

Outside of the image editing software, there are also several powerful free image optimization tools that you can use to optimize images for web (with just a few clicks).

We recommend using these tools to optimize images before you upload them to WordPress, specially if you are a perfectionist.

This method helps you save disk space on your WordPress hosting account, and it guarantee the fastest image with the best quality since you manually review each image.

Adobe Photoshop

Adobe Photoshop is a premium software that comes with a feature to save images optimized for the web. Simply open your image and click on the “File » Save for Web” option.

This will open a new dialog box. On the right, you can set different image formats. For JPEG format, you will see different quality options. When you select your options, it will also show you the file size on the bottom left.

Saving images optimized for the web using Photoshop

GIMP

GIMP is a free and open source alternative to popular Adobe Photoshop. It can be used to optimize your images for the web. The downside is that it is not as easy to use as some other solutions on this list.

First, you need to open your image in GIMP and then select File » Export As option. This will bring up the save file dialog box. Give your file a new name and then click on the export button.

Export image in GIMP

This will bring up image export options. For jpeg files, you can select the compression level to reduce file size. Finally, click on the export button to save the optimized image file.

TinyPNG

TinyPNG is a free web app that uses a smart lossy compression technique to reduce the size of your PNG files. All you have to do is go to their website and upload your images (simple drag & drop).

Using TinyPNG to optimize images for WordPress

They will compress the image, and give you the download link. You can use their sister website, TinyJPG, for JPEG image compression.

They also have an extension for Adobe Photoshop which is what we use as part of our image editing process because it combines the best of TinyPNG and TinyJPG inside Photoshop.

For developers, they have an API to convert images automatically, and for beginners they have a WordPress plugin that can automatically do it for you (more on this later).

JPEG Mini

JPEGmini uses a lossless compression technology which significantly reduces the size of images without affecting their perceptual quality. You can also compare the quality of your original image and the compressed image.

JPEGMini online image compression tool

You can use their web version for free, or purchase the program for your computer. They also have a paid API to automate the process for your server.

ImageOptim

ImageOptim is a Mac utility that allows you to compress images without losing any quality by finding the best compression parameters and removing unnecessary color profiles.

ImageOptim

Windows alternative to this is Trimage.

Best Image Optimization Plugins for WordPress

We believe that the best way to optimize your images is by doing it before uploading them to WordPress. However, if you run a multi-author site or need an automated solution, then you can try a WordPress image compression plugin.

Below is our list of the best WordPress image compression plugins:

  1. Optimole – popular plugin by the team behind ThemeIsle.
  2. EWWW Image Optimizer
  3. Compress JPEG & PNG images – plugin by TinyPNG team mentioned above in the article.
  4. Imagify – plugin by the popular WP Rocket plugin team.
  5. ShortPixel Image Optimizer
  6. WP Smush
  7. reSmush.it

Using any of these WordPress image optimization plugin will help you speed up your website.

Final Thoughts and Best Practices for Image Optimization

If you’re not saving images optimized for web, then you need to start doing so now. It will make a huge difference on your site speed, and your users will thank you for it.

Not to mention, faster websites are great for SEO, and you will likely see an increase in your search engine rankings.

Outside of image optimization, the two things that will significantly help you speed up your website is using a WordPress caching plugin and using a WordPress CDN.

Alternatively, you can use a managed WordPress hosting company because they often offer both caching and CDN as part of the platform.

We hope this article helped you learn how to optimize your images in WordPress. You may also want to see our guide on how to improve your WordPress security and the best WordPress plugins for business websites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

Categories
Website

How to Update WordPress Theme without Losing Customization

One of the best things about WordPress is the easy customization options that you get with WordPress themes and plugins.

You can also take these customizations to the next level by adding your own code snippets and CSS styles to your WordPress theme.

The problem arises when an update becomes available for your theme. If you are not careful, then there is a high chance that you’ll lose some of those changes you made to your theme.

In this article, we will show you how to easily update a WordPress theme without losing customization. We will also cover how to properly customize your themes, so you are not affected when a new theme update is released.

Properly updating WordPress theme without losing customizations

How Theme Updates Work in WordPress?

WordPress comes with a powerful system to install updates for not just WordPress itself but for plugins and themes as well.

Your WordPress website regularly checks for updates and display them under Dashboard » Updates page.

WordPress updates

When a theme update becomes available, you’ll also see a notification on the Appearance » Themes page.

Theme updates

Updates are really important for the security and performance of your WordPress website. Aside from security and bug fixes, theme developers can also introduce new features with these updates.

You can simply click on the update button to install the new version.

WordPress will then download the theme package, unzip it, and replace the old files with the newer version.

This will overwrite all old theme files installed on your website. If you manually added custom code to your WordPress theme files, then you’ll lose those changes.

That being said, let’s take a look at which theme changes are safe and which customizations will be erased.

What Type of Theme Customizations Can You Lose During an Update?

There are multiple ways you can customize a WordPress theme. Some of these theme customizations are safe because your changes are stored in the WordPress database itself.

This includes all changes made through the built-in WordPress theme customizer which you can access by visiting Appearance » Customize page.

WordPress theme customizer

The theme customizer allows you to modify your WordPress theme and store all changes in the WordPress database. You can change the header image, colors, layout, custom CSS, and more.

Your WordPress widgets and navigation menus are also not affected by the theme updates.

Popular WordPress themes like Astra and Ocean WP now come with companion plugins. These plugins are used to add extra features to your theme. Any theme changes made using these companion plugins are also not affected by the theme update.

If you customize your WordPress layout using a WordPress page builder like Divi, Beaver Builder, Elementor, etc, then those changes will also not be impacted.

Any other features that you have added to your website using a plugin are also safe. For example, your WordPress contact forms, Google Analytics, email newsletter popups, and more.

Customizations that you’ll lose during the update

If you have added any code to your theme’s functions.php file, then it will disappear. Any CSS changes that you have added directly to your theme’s stylesheet (style.css) file will also be wiped off.

Now that we know which changes will be erased, let’s talk about how to preserve and restore them after the theme update.

Step 1. Preparing for The Theme Update

First thing you need to do is connect to your WordPress hosting account using an FTP client.

Once connected, go to the /wp-content/themes/ folder and download your theme folder to your computer.

Download your WordPress theme

This folder will be the backup of your theme, and we will use it later to copy and paste customizations after updating the theme.

Step 2. Download The Updated Theme and Move Customizations

Now we want to transfer customizations we have made to the old theme files to the updated version.

Simply visit your theme’s website and download the latest version to your computer. Locate the theme’s zip file and extract it.

You should now have both, the new version and your old customized theme on your computer.

If you remember the changes you made to your theme, then simply copy and paste the code snippets from the old theme to the new version.

On the other hand, if you do not remember the changes you made, then you will have to find them first. The easiest way to do this is by comparing your theme files.

You’ll need to use a file comparison software like WinMerge (kaleidoscope for Mac, Meld for Linux).

Open both theme folders in file comparison software. It will show files side by side allowing you to quickly compares files to locate the customizations you have added to the old theme.

Compare theme changes

You can then copy and paste the code from the old theme file to the same file in the new theme.

Step 3. Upload the New Theme Folder

After copying your changes to the new theme, you are now ready to upload the updated version to your website.

Simply connect to your website using the FTP client and go to the /wp-content/themes/ folder. Select the new theme folder and update it to your website.

Upload updated theme

Your FTP client will warn you that the files with the same name already exist. You need to choose

Overwrite

That’s all. You have successfully updated your WordPress theme. Visit your website to make sure that everything is working as expected.

How to Avoid Losing Changes During Theme Update

If you want to add code snippets or custom styles to your WordPress theme, then there are some best practices that you should follow.

The best solution is to create a child theme and add your custom code to child theme’s files.

However, many WordPress beginners may not feel comfortable creating a child theme. Luckily, there are easier solutions available.

For all your custom code changes, you can use the code snippets plugin.

It allows you to safely add custom code snippets without breaking your website, and your changes will not be affected by theme updates. You can even change your WordPress theme without losing those changes.

For CSS code, you can save it all under the theme customizer’s ‘Additional CSS’ tab.

Additional CSS

For more information, see our guide on how to add custom CSS in WordPress.

Alternatively, you can also use the powerful CSS Hero plugin to easily customize the styles without even writing any CSS code.

We hope this article helped you update your WordPress theme without losing customization. If you come across any issues, then check out our guide on most common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

Categories
Website

How to Add and Use Widgets in WordPress

Beginner users often ask us what are widgets and how to use widgets in WordPress. Widgets allow you to add different functionality and features to your WordPress sidebars without writing any code. In this article, we will show you how to add and use Widgets in WordPress along with sharing Widget examples.

How to Add and Use Widgets in WordPress

What are Widgets? Why You Need to Use Widgets in WordPress?

Widgets are tiny blocks of specific functionality that you can place in your WordPress sidebars (also known as widget-ready-areas). For beginners, this is an easy way to add things like galleries, quotes, popular posts, facebook like boxes, and other dynamic items on their WordPress site.

Widgets can be found on Appearance » Widgets page in your WordPress admin area.

Widgets screen on a WordPress site

You will see the widgets that you can add under the list of available widgets.

On your right hand, you will find the designated areas on your WordPress site where you can place these widgets. These designated areas are defined by your WordPress theme. They are called sidebars or widget-ready areas.

If you don’t see a specific widget you’re looking for, then it can likely be added with a plugin (more on this later).

Adding Widget to a Sidebar in WordPress

There are multiple ways to add widgets to sidebars available in your WordPress theme. The easiest one is to simply drag and drop them to your sidebar.

Animation showing how to drag and drop a Widget to a sidebar in WordPress

You can also click on a widget title from the list of available widget. WordPress will show you the list of sidebars where you can add this widget.

Simply select the sidebar where you want to add the widget, and then click on Add widget button to add it.

Add widget button

There is also an accessibility mode for users who need it. To enable accessibility mode, you need to click on the Screen Options button at the top right corner of the screen.

Turn on accessibility mode for widgets in WordPress

It will display a fly down menu with a link to enable accessibility mode for widgets screen. Clicking on it will change the user interface of the widgets screen.

Each available widget will now have a simple ‘Add’ button. clicking on the button will take you to an accessible screen where you can easily select the sidebar.

Accessible widgets in WordPress

For detailed instructions see our guide on how to add WordPress widgets in accessibility mode.

The widgets page is not the only way to add widgets to your WordPress site. You can also add widgets using the live preview by visiting Appearance » Customize.

Animation adding a widget with customizer in WordPress

It’s important to note that not all of your widget-ready areas and sidebars will appear in the customizer. This is why we recommend using the Appearance » Widgets screen to add widgets in WordPress.

How to Remove a Widget in WordPress?

Removing a widget in WordPress is just as simple as adding them. Visit the Appearance » Widgets page.

Look for the widget that you want to remove in your sidebars and click on the widget title to expand it.

Removing a widget by deleting it from your WordPress sidebar

Below the widget settings, you will find the link to delete the widget. Deleting a widget will remove it from your sidebar and will also delete widget settings like title or any options that you selected.

Some widgets are too simple and don’t have many options in their settings while others have many options and settings. If you would like to remove a widget without losing the settings, then you need to drag and drop it to the inactive widgets section.

Removing a widget without deleting its settings

Deleting or sending a widget to inactive widgets does not remove it from the list of available widgets. You can always add a widget again from the list of available widgets or inactive widgets.

What Kind of Widgets are Available for WordPress?

A default WordPress installation comes with some built-in widgets like recent posts, recent comments, archives, search, etc.

Many WordPress themes and plugins come with their own plugins.

For example, Envira Gallery plugin allows you to create beautiful image galleries in your WordPress posts and pages. But it also comes with an Envira Gallery widget, which you can add to a sidebar to display image galleries in WordPress.

Envira gallery widget

Similarly, countless other themes and plugins add widgets, so their users can add things to their WordPress sidebars without writing any code or html.

There are hundreds of WordPress plugins that just add widgets for you to use in your sidebar. See our list of the 25 most useful WordPress widgets for your site.

What Else You Can do With WordPress Widgets?

Widgets are an incredibly powerful and flexible tool in WordPress. WordPress developers have been using them in many innovative ways.

As a WordPress site owner, you can take advantage of that to add almost anything imaginable to your WordPress site. Get started with our 12 WordPress sidebar tricks to get maximum results.

If you are comfortable with code, then you may want to learn how to create a custom WordPress widget of your own.

That’s all, we hope this article helped you learn how to add and use widgets in WordPress. You may also want to see our guide on how to display different sidebar for each post and page in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

Categories
Website

How to Backup & Restore WordPress Sites with UpdraftPlus

Backups are the first layer of security for any WordPress site. Aside from having automated backups, you also need to have an easy way to restore the backup if needed. In this article, we will show you how to easily backup and restore your WordPress site with UpdraftPlus.

UpdraftPlus

Why You Need a Backup & Restore Solution for WordPress?

Research shows that data loss and downtime cost $1.7 trillion each year to the globally economy.

All websites on the internet are vulnerable to data loss and security threats. As a website owner, these are some common scenarios when you may lose your data:

  • Your website can get hacked and hackers may destroy your data.
  • Your hosting provider can lose your data
  • Your host reserves the right to terminate your account and delete all your data.

There are many other scenarios where you could end up losing your website and all the valuable data created over the years.

The best way to protect yourself against these threats is to regularly backup your WordPress site.

WordPress does not come with a built-in backup solution. However, there are several great WordPress backup plugins which allow you to automatically backup and restore your WordPress site.

UpdraftPlus is one of the best WordPress backup plugins. It allows you to setup automatic backup schedules. It will also help you restore your WordPress site in case something bad happens.

Having said that, let’s take a look at how to easily backup and restore your WordPress site with UpdraftPlus.

Creating WordPress Backup with UpdraftPlus

First thing you need to do is install and activate the UpdraftPlus plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » UpdraftPlus Backups page to configure plugin settings.

Settings page UpdraftPlus

Now you need to click on the settings tab.

This is where you will set up an automatic backup schedule and a remote location to store your backups.

UpdraftPlus settings

First you need to choose a backup schedule for your files. Files include your WordPress themes, plugins, images and other uploads.

After that you need to select a backup schedule for your WordPress database. WordPress is a database driven software. All your posts and pages, comments, website settings, are stored in the database.

Your backup schedule should be based on how often you add new content to your website.

For example, If you add two blog posts each week, then you can select a fortnightly backup of files and weekly backup of database.

Next, you need to choose where to store your backup files.

It is a bad idea to save your backups on the same location as your website. Losing your website, means you will also lose access to your backup files.

This is why you need to choose a remote cloud storage service to store your backups.

UpdraftPlus allows you to save your backups to several cloud storage services including Dropbox, Google Drive, Microsoft OneDrive, any many others. You can also send your backups to an email address.

Simply click on a remote service to select it, and you will see setup instructions below.

For the sake of this tutorial, we will show you how to use Dropbox as your remote backup storage service with UpdraftPlus.

We will go ahead and click on Dropbox to select it and then scroll down to the bottom of the page and click on the save changes button.

UpdraftPlus will save your settings. However, you still need to give UpdraftPlus access to your Dropbox account.

Scroll down to remote storage setup instructions and click on the link next to ‘Authenticate with Dropbox’ option.

Setting up Dropbox as your remote storage service for backups

The link will take you to the Dropbox website where you will be asked to sign-in using your Dropbox email and password.

After login, you will be asked if you want to allow UpdraftPlus to access your Dropbox account.

Allow UpdraftPlus to access Dropbox

UpdraftPlus will only have permission to access its own folder in ‘Apps » UpdraftPlus” folder. Click on ‘Allow’ button to continue.

You will be redirected to UpdraftPlus website where you need to click on ‘Complete Setup’ button to finish setup.

Complete setup

You will now be taken back to your WordPress site, and you will see the UpdraftPlus settings page again. Scroll down to the bottom of the page and click on the Save Changes button.

You have now setup backup schedule and remote location to store your backups.

Creating Manual WordPress Backups with UpdraftPlus

UpdraftPlus can automatically create backups based on the schedule you selected earlier. However, you can also manually create backups any time you want.

First you need to visit Settings » UpdraftPlus Backups and click on ‘Backup Now’ button.

Creating a manual backup with UpdraftPlus

This will bring up a pop-up with options to select files/database backup and whether you want to send the backup to remote storage. (see which WordPress files should you backup?)

Manual backup

Click on the ‘Backup Now’ button to continue.

UpdraftPlus will now start creating backup of your files and database. You will be able to see the progress on the settings page.

Backup Progress

The process may take a while depending on the size of your website.

UpdraftPlus will also start uploading your backup files to the remote location.

Restoring Your WordPress Backup with UpdraftPlus

Creating backups is easy, but the real useful part about backups is the ability to restore them with the same ease.

UpdraftPlus makes it easy to restore your WordPress site from a backup.

If your WordPress site was hacked or you want to start fresh, then first you will need to delete everything and install WordPress again.

Next, you will need to install and activate the UpdraftPlus plugin again on your fresh new WordPress site.

Upon activation, you need to visit Settings » UpdraftPlus Backups page and click on Restore button.

This will bring you to the backups page. UpdraftPlus will scan your server to see if it can find an existing backup in /wp-content/updraft/ folder on your website.

However, since you deleted everything from your website it will not be able to find the backup files.

If you saved the backup files on your computer, then you can click on ‘Upload backup files’ link to manually upload and restore them.

Upload backup files manually

You can also connect UpdraftPlus to remote location (Dropbox, Google Drive, etc). This way UpdraftPlus will be able to scan remote location and use your previously stored backups.

Click on the Settings tab and then choose the remote location you used earlier to store your backups.

Reconnect remote storage location

Follow the instructions to authenticate your website with the remote storage service.

Don’t forget to click on the ‘Save Changes’ button at the bottom of the page to restore your settings.

Now you can switch back to ‘Existing Backups’ tab and click on the ‘Rescan remote location’ link.

Remote backups

UpdraftPlus will now look for backups in the remote storage location and display them below.

You can now click on the restore button next to a backup.

UpdraftPlus will now ask you what you would like to restore. You need to select all options and then click ‘Restore’ button.

Restore options

UpdraftPlus will now fetch your backup files from the remote location and start restoring your site from the backup.

Our UpdraftPlus Review

UpdraftPlus is a powerful WordPress backup plugin, and it’s a great option for DIY users who want the flexibility to choose their backup schedule and remote storage location.

Because UpdraftPlus is free, it’s a popular choice among users. However you can upgrade to UpdraftPlus Premium to access premium addons such as Website Migrator, UpdraftVault, priority support, and more options. The premium option costs $70 per year.

However like most WordPress backup plugins, UpdraftPlus lacks the ability to do realtime backups of your website.

If you want real-time backups, unlimited storage, and don’t want to pay a third-party storage service like Dropbox, then we recommend using VaultPress instead. This is what we use on WPBeginner.

The downside of VaultPress is cost. The real-time backup plan for one site costs $165 per year which is more than twice UpdraftPlus premium which gets you access for two sites and obviously a non-comparison with the free version.

Final Thoughts

Backups allow you to recover your website in an emergency. However, they cannot protect your website against common security threats like hacking, malware, code injection, etc.

At WPBeginner, we use Sucuri to protect our site (see how Sucuri helped us block 450,000 WordPress attacks).

You need to make sure that your WordPress site is secure. Follow the instructions in our ultimate WordPress security guide to strengthen your WordPress security.

That’s all, we hope this article helped you easily backup and restore WordPress sites with UpdraftPlus.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

Categories
Website

55+ Most Wanted WordPress Tips, Tricks, and Hacks

Ever wondered what WordPress tips, tricks, and hacks most popular WordPress sites are using? In this article, we will share some of the most wanted WordPress tips, tricks, and hacks that will help you use WordPress like a pro.

Most wanted WordPress tips, tricks, and hacks

1. Use a Custom Homepage

By default, WordPress shows your latest posts on the homepage of your website. You can change that and use any page as your site’s homepage.

First you need to create a new page in WordPress, and you can name this page home. Next, you will need to create another page and let’s call this page blog as you will use it to display your blog posts.

Now go to Settings » Reading page in your WordPress admin and under ‘Front page displays’ option and switch to ‘A static page’. After that you will be able to select the pages you just created as your home and blog pages.

Static Front Page

You can also create a custom homepage template to use for your home page. Simply create a new file on your computer using a plain text editor and add this code at the top of it.


Save this file as custom-homepage.php on your desktop.

Next, you need to connect to your website using an FTP client and go to /wp-content/themes/your-current-theme/ folder. Now upload the file you created earlier to your theme folder.

Return back to the WordPress admin area and edit your home page. You will be able to select your custom homepage template under the page attributes metabox.

Custom home page template

For more details see our guide on how to create a custom page template in WordPress.

Now this page will be completely empty and it will not show anything at all. You can use custom HTML/CSS and WordPress template tags to build your own page layout. You can also use a page builder plugin to easily create one using drag and drop tools.

2. Install Google Analytics in WordPress

Google Analytics is one of the must have tools for WordPress site owners. It allows you to see where your users are coming from and what they are doing on your website.

The best way to install Google Analytics is by using the MonsterInsights plugin. You can insert Google Analytics code into your theme files, but this code will disappear when you update or switch your theme.

For detailed instructions see our step by step guide on how to install Google Analytics in WordPress.

3. Password Protect WordPress Admin Directory

WordPress admin directory is where you perform all administrative tasks on your website. It is already password protected as users are required to enter username and password before they can access the admin area.

However by adding another layer of authentication, you can make it difficult for hackers to gain access to your WordPress site.

Here is how to enable password protection for your WordPress admin directory.

Login to cPanel dashboard of your WordPress hosting account. Under the security section, you need to click on ‘Password Protect Directories’ icon.

Password protect directories

Next, you will be asked to select the directories you want to protect. Select /wp-admin/ folder and next create a username and password.

Security settings

That is it. Now when you try to access your wp-admin directory, you should see an authentication required box like this:

Password protected directory

For alternate method and more detailed instructions see our guide on how to password protect your WordPress admin directory.

4. Show Images in Rows and Columns

Display photos in rows and columns

By default, when you add multiple images to a WordPress post, they would appear right next to each other or on top of each other. This does not look very good because your users will have to scroll a lot to see all of them.

This can be solved by displaying thumbnail images in a grid layout. This gives your website a more compact look and improves user experience.

For complete step by step instructions, see our guide on how to display WordPress photos in rows and columns.

5. Allow users to Subscribe to Comments

Comment subscription checkbox

Normally when users leave a comment on your website, they will have to manually visit the same article again to see if you or other users replied to comments.

Wouldn’t it be better if users were able to get email notifications about new comments on your posts? Here is how to add this feature to your website.

Simply install and activate the Subscribe to Comments Reloaded plugin. Upon activation, you need to visit Settings » Subscribe to Comments to configure the plugin settings.

For detailed instructions see our guide on how to allow users to subscribe to comments in WordPress.

6. Limit login attempts

Locked out login

By default, a WordPress user can make unlimited number of attempts to login to a WordPress site. This allows anyone to try guessing your password until they get it right.

To control this, you need to install and activate the Login LockDown plugin. It allows you to set limits on the number of failed attempts a user can make to login.

For detailed setup instructions see our guide on how to limit login attempts in WordPress.

7. Display Excerpt (Post Summary) on Home and Archive Pages

Post excerpts

You may have noticed that all popular blogs show article summary instead of full article on their home and archive pages. It makes those pages load faster, increases page views, and avoids duplicate content across your website.

For more on this topic, see our article on excerpt (summary) vs full posts in WordPress archive pages.

Many premium and free WordPress themes already use excerpts on home and archive pages. However, if your theme doesn’t display excerpts, then see our guide on how to display post excerpts in WordPress themes.

8. Add Custom Default Gravatar Image

WordPress uses Gravatar to display user profile photos in WordPress. If a user does not have a gravatar, then WordPress uses a default image which is called ‘Mystery Person’.

This default gravatar image will appear many times in your WordPress comments area simply because a lot of users do not have a gravatar image associated with their email address.

You can easily replace this default gravatar with your own custom default gravatar image.

First you will need to upload the image you want to use as your default gravatar image to your WordPress media library.

Next, you need to copy the image file URL.

Copy file URL

Now you need to add the following code to your theme’s functions.php file or a site-specific plugin.

add_filter( 'avatar_defaults', 'wpb_new_gravatar' );
function wpb_new_gravatar ($avatar_defaults) {
$myavatar = 'http://example.com/wp-content/uploads/2017/01/wpb-default-gravatar.png';
$avatar_defaults[$myavatar] = "Default Gravatar";
return $avatar_defaults;
}

Don’t forget to replace $myavatar value with the URL of the custom gravatar image you uploaded earlier.

You can now visit Settings » Discussion page, and you will notice your custom default avatar added to default avatar choices.

For detailed instructions check out our tutorial on how to add change the default gravatar in WordPress.

9. Adding custom CSS to a WordPress Theme

As a WordPress site owner, sometimes you may need to add custom CSS to your site. CSS allows you to change the appearance of things on your WordPress site like colors, margins, font sizes, etc.

The easiest way to add custom CSS to any WordPress theme is by visiting the Appearance » Customize page in your WordPress admin. This will launch the WordPress theme customizer, and you will see your website’s preview in the right panel.

Now click on the ‘Additional CSS’ menu in the left panel to expand it.

Additional CSS in theme customizer

You will see a plain text box where you can add your custom CSS. As soon as you add a valid CSS rule, you will be able to see it applied on your website’s live preview pane.

Custom CSS code and preview

Don’t forget to click on the ‘Save & Publish’ button on the top when you are finished.

For alternate methods and more detailed instructions check out our beginner’s guide on how to add custom CSS in WordPress.

10. Using Inspect Element Tool to Customize WordPress

Adding custom CSS sounds great, but how do you know which CSS classes to edit? How do you debug it without actually having to write CSS?

Using Inspect Element tool, you can edit HTML, CSS, or JavaScript code for any webpage and see your changes live (only on your computer).

For a DIY website owner, these tools can help you preview how a site design would look without actually making the changes for everyone.

Simply point and right click on any element on a page, then select ‘Inspect’ from your browser’s menu.

Opening Inspect Element or developer tools in your browser

This will split your browser window, and you will be able to see the HTML and CSS source code of the page.

HTML and CSS panels in Inspect tool

Any changes you make here will be immediately visible on the page above. However, keep in mind that these changes are only happening in your browser and you are not actually editing the page.

This allows you to figure out what you need to edit and how. After that you can go ahead and change your actual theme files or custom CSS code.

For more on this topic, see our article on basics of Inspect element and customizing WordPress as DIY user.

11. Add a Facebook Thumbnail Image

Facebook can automatically pick up an image from your articles when they are shared by you or anyone else. Usually it picks the featured image of an article. However, sometimes it may pick a random image from the article that may not be suitable.

If you are using Yoast SEO plugin, then you can select a Facebook thumbnail image in Yoast SEO metabox on the post edit screen.

Selecting a Facebook thumbnail image for an article in Yoast SEO

You can also select a Facebook thumbnail image for your homepage by visiting SEO » Social page.

Setting a Facebook thumbnail for home page

If you are not using Yoast SEO plugin, then see our guide on how to fix Facebook incorrect thumbnail issue in WordPress.

12. Add Featured Image or Post Thumbnail to RSS Feed

WordPress RSS feeds shows a list of your most recent articles. If you are showing full articles in the feed, then all images inside will be displayed. However, it does not include the featured image or post thumbnail in the article.

To fix this, you can add the following code to your theme’s functions.php file or a site-specific plugin.

function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '

' . get_the_post_thumbnail($post->ID) . '

' . get_the_content(); } return $content; } add_filter('the_excerpt_rss', 'rss_post_thumbnail'); add_filter('the_content_feed', 'rss_post_thumbnail');

For more information, see our tutorial on how to add post thumbnail to RSS feeds in WordPress.

13. Show Excerpts in RSS Feed

By default, WordPress shows your full article in the RSS feed. This allows content scrapers to automatically fetch and steal your full articles. It also prevents your RSS feed subscribers from visiting your website.

To fix this, head over to Settings » Reading page and scroll down to ‘For each article in a feed, show’ option. Select summary and then click on the save changes button.

14. Use Shortcodes inside Text Widgets

Shortcodes allow you to easily add small functions into WordPress posts and pages. However, they do not work in the text widget.

To run shortcodes in your sidebar text widgets, you need to add this code to your theme’s functions.php file or a site-specific plugin.

add_filter('widget_text', 'do_shortcode');

You can also use the Shortcode Widget plugin, which adds a shortcode enabled text widget to your WordPress site.

For more information, take a look at our guide on how to add shortcodes in WordPress sidebar widgets.

15. Add Images in WordPress Sidebar

WordPress does not come with an easy way to just upload and display images in your sidebar (though it is expected to change soon in an upcoming version). At the moment if you want to add an image, then you need to add the HTML code for it.

First, you need to upload the image to your WordPress site using the media uploader and copy its URL.

Next, go to Appearance » Widgets page and add a text widget to your sidebar. Inside the text widget you will need to add the HTML in the following format.

Alternate text

You can now save your widget settings and preview your website.

For more details see our guide on how to add an image in WordPress sidebar widget.

16. Add Content to Articles in RSS Feeds

Want to manipulate your WordPress RSS feeds by adding content to your articles visible only for your RSS feed subscribers?

Add the following code to your theme’s functions.php file or a site-specific plugin.

function wpbeginner_postrss($content) {
if(is_feed()){
$content = 'This post was written by Syed Balkhi '.$content.'Check out WPBeginner';
}
return $content;
}
add_filter('the_excerpt_rss', 'wpbeginner_postrss');
add_filter('the_content', 'wpbeginner_postrss');

This code shows the text ‘This post was written by Syed Balkhi’ before an article and ‘Check out WPBeginner’ after the article.

For more ways to manipulate RSS feed content, see our guide on how to add content in your WordPress RSS feeds.

17. Delay Posts in RSS Feeds

Have you ever published an article accidentally before it was ready to go live? We have all been there. You can easily just unpublish the article and continue editing it.

However, RSS feed readers and email subscribers may already get it in their inbox. There is an easy fix to avoid this -delaying posts from appearing in your RSS feed.

Add the following code to your theme’s functions.php file or a site-specific plugin.

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

This code delays your published posts from appearing in RSS feed for 10 minutes.

For more details see our article on how to delay posts from appearing in WordPress RSS feed.

18. Display Random Header Images in WordPress

Want to display random header images on your WordPress site? Most WordPress themes come with built-in support to display header image across your website. However, you can also upload multiple header images and allow your theme to randomly display a header image.

Head over to Appearance » Customize page and then click on the ‘Header’ Section to expand it. Now upload all the header images that you want to use and then click on the ‘Randomize header images’ button.

Randomize header images in WordPress

If you want to display select few images on different articles and pages, then check out our guide on how to add random header images to your WordPress site.

19. Add Image Icons to Links Navigation Menu

Adding menu icons

Do you want to display image icons next to links in your navigation menu? The easiest solution is to use the Menu Image plugin.

After installing the plugin, simply head over to Appearance » Menu, and you will see the option to add images with each item in your existing menu.

If for some reason, you don’t want to use a plugin and would rather do it manually, then follow the steps below:

First you need to visit Appearance » Menus page and then click on the Screen Options button at the top right corner of the screen.

Enable CSS classes option for Navigation Menus

This will bring down a menu where you need to check the box next to CSS classes option.

After that scroll down to your navigation menu and click on an item to expand it. You will see an option to add CSS classes. Enter a different CSS class for each menu item.

Adding a CSS class to a menu item in WordPress

Don’t forget to click on the save menu button to store your changes.

Next, you need to upload the image icons to your WordPress site by visiting Media » Add Media page. After uploading the image files copy their URLs as you will need them in the next step.

Now you can add an image icon to your navigation menu by adding custom CSS. Here is a sample CSS that you can use as an starting point.

.homepage {
background-image: url('http://www.example.com/wp-content/uploads/2014/12/home.png');
background-repeat: no-repeat;
background-position: left;
padding-left: 5px;
}

Don’t forget to replace image URL with your own image file URL.

20. Open Navigation Menu Link in New Window

Sometimes you may need to make a navigation menu link open in a new window. The problem is you do not see an option to do that when adding menu items.

Actually, the option is hidden to remove clutter from the screen. You will need to click on the screen options button at the top right corner of the screen and check the ‘link target’ option.

Link target option in navigation menu screen

Next, you need to scroll down to the menu item that you want to open in a new window. Click on the menu item to expand it, and you will see the option to open link in a new tab.

Open link in a new tab or window

Don’t forget to click on the save menu button to store your changes.

21. Add Full Screen Search Overlay in WordPress

Full screen search overlay on a WordPress site

If you click on the search icon at the top right corner of any page on WPBeginner, then you will notice a full screen search overlay appear. It improves search experience and makes it more engaging.

You can add this to your WordPress site as well. The easiest way to do this is by installing and activating the WordPress Full Screen Search Overlay plugin.

The plugin works out of the box and there are no settings for you to configure. Upon activation, it turns any default WordPress search form field into a full screen search overlay.

For more details, see our guide on how to add a full screen search overlay in WordPress.

22. Add a Sticky Floating Navigation Menu

A sticky floating navigation menu stays on top of the screen as a user scrolls down. Some WordPress themes have this feature as an option in their settings. If your theme doesn’t have this option, then you can try this method.

First, you need to install and activate the Sticky Menu (or Anything!) on Scroll plugin.

Upon activation, go to plugin’s settings page located under Settings » Sticky Menu (or Anything!). Add the CSS class of your navigation menu and save changes.

For detailed instructions, see our tutorial on how to create a sticky floating navigation menu in WordPress.

23. Add multiple authors to a WordPress post

Do you want to credit multiple authors for an article on your website? By default, WordPress posts are assigned to a single author. However, if you often need to credit multiple authors, then there is an easier way to to do this.

You will need to install and activate the Co-Authors Plus plugin.

Now go ahead and edit the post or page where you want to credit multiple authors. On the post edit screen, you will notice the new ‘Authors’ box just below the post editor where you can credit multiple authors.

Select multiple authors

24. Add Categories to WordPress Pages

Want to add categories and tags to pages in WordPress? By default, they are only available for posts. Mainly, because pages are supposed to be static standalone content (see difference between posts and pages in WordPress).

If you want to add categories and tags, then simply add this code to your theme’s functions.php file or a site-specific plugin.

// 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 hooks
add_action('init', 'tags_categories_support_all');
add_action('pre_get_posts', 'tags_categories_support_query');

25. Create a Local WordPress Site on Your Computer

Many WordPress site owners and developers install WordPress on their computer. It allows you to develop a WordPress site locally, try plugins and themes, and learn WordPress basics.

We created detailed step by step instructions on how to install WordPress on your Windows computer or on Mac using MAMP.

26. Display Total Number of Comments in WordPress

Comments provide an easier way for users to engage with content on your website. Showing total number of comments can be used as social proof and encourage more users to participate in discussions.

The easiest way to do this is by installing the Simple Blog Stats plugin. Upon activation, you can add [sbs_apoproved] shortcode to any post or page to display total number of comments.

For a code method and more instructions see our article on how to display total number of comments in WordPress.

27. Show Total Number of Registered Users in WordPress

User count preview in WordPress

If you allow users to register on your WordPress site, then showing total number of registered users can encourage more users to signup.

The easiest way to do this is by installing the Simple Blog Stats plugin. Upon activation, you can add [sbs_users] shortcode to any post or page to display total number of registered users.

For more detailed instructions, see our tutorial on how to show total number of registered users in WordPress.

28. Create New Image Sizes in WordPress

When you upload an image to your blog, WordPress automatically creates several copies of the image. Your WordPress theme and plugins can also add new image sizes.

To create new image sizes in WordPress, you need to add the following code to your theme’s functions.php file or a site-specific plugin.

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

This code adds three new image sizes. Don’t forget to change image size names and dimensions to your own requirements.

For more information, see our tutorial on how to create new image sizes in WordPress.

29. Add Category Icons in WordPress

Want to add category icons or images next to category names in WordPress? It makes your category archive pages look more engaging and improves user experience.

First you need to install and activate the Taxonomy Images plugin in WordPress. Upon activation, head over to Posts » Categories and click on the add button next to blank thumbnail icon for each category.

Add category images in WordPress

For detailed instructions, see our guide on how to add taxonomy images (category icons) in WordPress.

30. Convert Categories to Tags or Vice versa

Often folks are not clear about how to properly use categories and tags in WordPress. Sometimes you may end up creating categories which should have been tags or vice versa.

It is easily fixable.

Head over to Tools » Import page and then install Categories and Tags Converter.

Install categories and tags converter in WordPress

After installation, click on the run importer link to continue.

On the converter page, you can switch between categories to tags or tags to categories converter. Next, select the items you want to convert and then click on the convert button.

Convert button

31. Bulk Move Posts Between Categories and Tags

Sometimes you may want to bulk move posts between categories and tags. Doing that one by one for each post can be time consuming.

Actually, there is a plugin for that. Simply install and activate the Bulk Move plugin. Upon activation, you need to go to Tools » Bulk Move to move your posts.

Moving posts between categories and categories

For more detailed instructions, visit our tutorial on how to bulk move posts to categories and tags in WordPress.

32. Display Last Updated Date of Your Posts

Last updated date for posts in WordPress

By default, most WordPress themes will show the date when an article was published. This is fine, and would work for most websites and blogs.

However, if you regularly update your old content, then you may want to show your users when an article was last updated. Otherwise you users wouldn’t notice that the article contains current information.

This can be achieved by adding the following code to

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 .= '

Last updated on '. $updated_date . ' at '. $updated_time .'

'; } $custom_content .= $content; return $custom_content; } add_filter( 'the_content', 'wpb_last_updated_date' );

For more detailed instructions see our guide on how to display last updated date in WordPress.

33. How to Display Relative Dates in WordPress

Want to display relative dates like yesterday, 10 hours ago, or a week ago for your posts in WordPress? Relative dates give users a sense of how much time has passed since something was posted.

To add relative dates, you need to install and activate the Meks Time Ago plugin. Upon activation, you need to visit Settings » General page and scroll down to ‘Meks Time Ago Options’ section.

Meks Time Ago plugin settings

You can select when to use time ago and how to display it. Don’t forget to click on the save changes button to store your settings.

For more details, see our guide on how to display relative dates in WordPress.

34. Remove WordPress Version Number

By default WordPress adds the WordPress version in your website’s header. Some people think it’s a security liability to which our answer is to keep WordPress updated.

However if you want to remove the WordPress version number, simply add the following code to your theme’s functions.php file or a site-specific plugin.

function wpbeginner_remove_version() {
return '';
}
add_filter('the_generator', 'wpbeginner_remove_version');

For more information on this topic see our article on the right way to remove WordPress version number.

35. Update WordPress URLs when Not Able to Access WP-Admin

WordPress Site Address

Sometimes when moving a WordPress site to new domain or due to a misconfiguration you may need to update WordPress URLs.

These URLs tell WordPress where to display your site and where WordPress core files are located. Incorrect settings can lock you out of WordPress admin area or redirect you to the old website.

The easiest way to update WordPress URLs is by adding this code to your current theme’s functions.php file.

update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Don’t forget to replace example.com with your own domain name. Once you access your WordPress site go to Settings » General page and update the URLs there. After that you need to remove the code you added to the functions file.

If you also need to update URLs in your posts and pages, then see our guide on how to properly update URLs when moving your WordPress site.

36. Deactivate All Plugins when not able to access WP-admin

When troubleshooting WordPress errors, you will be often asked to deactivate all WordPress plugins. You can just go to Plugins page and deactivate all plugins. But what if you are locked out of your WordPress site?

Here is how you can easily deactivate plugins when locked out of admin area.

First connect to your WordPress site using an FTP client and go to /wp-content/ folder. Inside it, you will find the plugins folder.

Renaming plugins folder to deactivate all WordPress plugins

Now you just need to rename the plugins folder to plugins.old and WordPress will automatically deactivate all plugins.

For alternate method and more information see our guide on how to deactivate all plugins when not able to access wp-admin.

37. Remove Default Image Links in WordPress

By default, when you upload images using the media uploader, WordPress asks you select how you would like to link to an image. If you don’t want to link to an image, then you can select None.

A better way to deal with this is by adding the following code to your theme’s functions.php file or a site-specific plugin.

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

This code automatically sets default image linking option to none.

For more on this topic check out our guide on how to automatically remove default image link in WordPress.

38. Include Category in Post URLs

You may have noticed that many WordPress sites use category in their post URLs. This allows them to add more useful information into a URL which is good for user experience as well as SEO.

If you want to add category name into your WordPress post URLs, then head over to Settings » Permalinks page. Click on the custom structure and add /%category%/%postname%/ in the field next to it.

Adding category to WordPress post URLs

Don’t forget to click on the save changes button to store your settings.

To learn more on how WordPress will handle subcategories and multiple categories, see our guide on how to include category and subcategories in WordPress URLs.

39. Display Random Posts in WordPress

Want to display random posts in your WordPress sidebar? Random posts give your users a chance to discover articles that they would otherwise never get to see.

First, you need to install and activate the Advanced Random Posts Widget plugin. Upon activation, head over to Appearance » Widgets page and then add Random Posts widget to a sidebar.

For an alternate code method, see our guide on how to display random posts in WordPress.

40. Allow user registration on your WordPress Site

WordPress comes with a powerful user management system with different roles and capabilities. If you want to allow users to register on your site, here is how you would turn on that feature.

Head over to Settings » General page and click on the check box next to ‘membership’ option. Below that you need to choose the default role that will be assigned to new users, if you are unsure, then use subscriber.

For more details see our guide on how to allow user registration on your WordPress site.

41. Create a Custom User Registration Form in WordPress

When you open user registration on your site, users will be using the default WordPress registration form. You can replace it with a custom user registration form for an improved user experience.

First you will need to install and activate the WPForms plugin. You will need at least the Pro plan to get access to their user registration addon.

Upon activation, go to WPForms » Addons page to install and activate the user registration addon.

After that you need to create a new form by visiting WPForms » Add New page. This will launch the WPForms builder where you need to select the User Registration Form as your template.

After creating your form you need to click on the embed button to copy the embed code. Now you can add this code to any WordPress post or page to display your custom user registration form.

For more detailed instructions see our guide on how to create a custom user registration form in WordPress.

42. Exclude Specific Categories from RSS Feed

Sometimes you may need to exclude specific categories from your WordPress RSS feed. The easiest way to do that is by installing and activating the Ultimate Category Excluder plugin.

Upon activation, head over to Settings » Category Exclusion page to configure plugin settings.

Category excluder

Select the categories you want to exclude and then click on the save changes button to store your settings.

43. Change Excerpt Length in WordPress

The default WordPress excerpt length is often too short to describe a post’s summary. To change excerpt length you can add the following code to your theme’s functions.php file or a site-specific plugin.

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

If you do not want to mess with code, then see our guide on how to customize WordPress excerpts (no coding required).

44. Display Dynamic Copyright Date in WordPress

To add a copyright date to your WordPress site’s footer, you can just edit the footer template in your theme and add a copyright notice. However, the year you use in the code will need to be manually updated next year.

Instead, you can use the following code to dynamically display the current year in your copyright notice.

© 2009 –  YourSite.com

For more advance solution, check out our article on how to add dynamic copyright date in WordPress.

45. How to Change a User Name in WordPress

WordPress allows you to easily change the name of a user, but you cannot change the username. There are two ways of doing this.

The easiest way is by using a plugin called Username Changer. After activating the plugin, go to Users » Username Changer page in your WordPress admin.

Changing a username in WordPress with Username Changer plugin

Select the username you want to change, and then enter the new username.

For alternate methods, see our article on how to change your WordPress username.

46. Allow Users to Like or Dislike Comments

WordPress comment with like dislike buttons

Have you seen how many popular sites like YouTube allow users to like and dislike comments. This brings more user engagement to the discussion on your website.

First you need to install and activate the Comments Like Dislike plugin.

Upon activation, you need to visit Comments » Comments Like Dislike page to configure plugin settings.

Like Dislike Comments

For more details, see our guide on how to allow users to like or dislike comments in WordPress.

47. Duplicate a WordPress Post or Page

The manual way to do duplicate a post is by creating a new post or page and then copying the content from the old one. However, this wouldn’t copy the post settings like categories, featured image, tags, etc.

The more efficient way to do this is by using the Duplicate Post plugin. Simply install and activate the plugin and then go to Posts » All Posts page.

Cone or draft a WordPress post

You will see the option to clone a post or create a new draft.

For more detailed instructions, see our article on how to easily duplicate posts and pages in WordPress with a single click.

48. Allow Users to Submit Posts to Your WordPress Site

Authors on your WordPress site can just login to their account and write posts. But what if you wanted your users to be able to submit posts directly without creating an account?

The best way to do this by creating a blog post submission form.

You will need to install and activate the WPForms plugin. You will need the pro version of the plugin to access the post submission addon.

Upon activation, go to WPForms » Addons page to download and activate the post submissions addon.

After that you can go to WPForms » Add New page and then select ‘Blog post submission form’ as your template.

Blog post submission form

Once you are done editing the form click on the embed button to copy the form embed code. Now you can paste this code in any WordPress post or page to display a blog post submission form.

Posts submitted by users will be stored in your WordPress posts as pending review. You can then review, edit and publish them.

For more detailed instructions, take a look at our guide on how to allow users to submit posts to your WordPress site.

49. Turn Off Comment Notification Emails in WordPress

WordPress automatically sends email notifications when someone leaves a comment or when a comment is awaiting moderation. This is exciting when you first start your blog, but it becomes very annoying after a short while.

The good news is that you can easily turn these notifications off. Visit the Settings » Discussion page on your WordPress admin and then scroll down to ‘Email Me Whenever’ section. Uncheck both options and then click on the save changes button.

Turn off comment notification emails

50. Change Sender Name in Outgoing WordPress Emails

By default, when WordPress sends an email notification it uses ‘WordPress’ as the sender name. This looks a bit unprofessional and you may want to change it to a real person or your website title.

You can easily change that by adding this code to your theme’s functions file or a site-specific plugin.

// Function to change email address

function wpb_sender_email( $original_email_address ) {
    return 'tim.smith@example.com';
}

// Function to change sender name
function wpb_sender_name( $original_email_from ) {
	return 'Tim Smith';
}

// Hooking up our functions to WordPress filters 
add_filter( 'wp_mail_from', 'wpb_sender_email' );
add_filter( 'wp_mail_from_name', 'wpb_sender_name' );

If you would rather do it using a plugin, then see our guide on how to change sender name in outgoing WordPress emails.

51. Changing the Author of a WordPress Post

Want to change the author of a WordPress post? By default, the option to change post author is hidden on the post edit screen.

You will need to edit the post where you want to change the author name and then click on Screen Options button at the top right corner of the screen. Check the box next to author option.

Enable author box

This will display the author meta box on the post edit screen where you can select a different author for the post.

For more details, check out our article on how to change the author of a post in WordPress.

52. Rearrange Post Edit Screen in WordPress

Sometimes you may feel that categories are located too far down on the post edit screen, or featured image box should be higher.

Many users don’t notice it for a while but all the boxes on the post edit screen are quite flexible. You can click to collapse them and even drag and drop them to arrange the post edit screen.

Rearrange post edit screen in WordPress

To learn more, see our tutorial on how to rearrange post edit screen in WordPress.

53. Change Number of Posts Shown on Blog Pages

By default, WordPress shows 10 posts on your blog pages and archives. You can change that to any number you want.

You will need to visit Settings » Reading page and then scroll down to ‘Blog pages show at most’ option. Enter the number of posts you want to display and then click on the save changes button.

Change number of posts

54. Automatically Close Comments on Old Articles

Sometimes you would notice that some very old posts on your site start getting regular spam comments for no apparent reason. One way to deal with this is by closing comments on older articles.

WordPress allows you to automatically turn off comments on old articles. You need to visit Settings » Discussion page and then scroll down to ‘Other comment settings’ section.

Disable comments on old posts

To learn how to deal with spam comments, see these tips to combat comment spam in WordPress.

55. Split Long Posts into Pages

Want to split lengthy posts into pages so that users can easily navigate them without scrolling too much? WordPress makes it super easy, just add the follow code where you want to split a post into next page.

WordPress will add page break at this point and rest of the post will appear on the next page. You can add the same code again when you want to start another page, and so on.

For more detailed instructions see our guide on how to split WordPress posts into multiple pages.

That’s all for now.

We hope this article helped you find some new WordPress tips, tricks, and hacks. You may also want to see our ultimate guide to boost WordPress speed and performance.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link