Stick around for an essential walkthrough that promises impressive results!
The HTTP/2 protocol lets many downloads happen at once. This means that your web host does not have to combine files if it supports this kind of download. But without it, combining files saves time and speeds up the site.
Plugins like Autoptimize and Asset CleanUp are great tools to do this job well.
Keep in mind that you may not need this step if your web host supports HTTP/2 protocol. This is because it allows for fast downloads of different resources at once!
Read more to find out how.
Using Autoptimize Plugin
- First, install Autoptimize as you would any other plugin.
- Go to the settings page after the install.
- You also have an option to add scripts that you don’t want to be optimized.
- Click on ‘Save Changes’ to finish it up.
Using Asset CleanUp Plugin
- Install the Asset CleanUp plugin first.
- Open your WordPress dashboard and go to Plugins.
- Find “Asset CleanUp” and click ‘Activate’.
- Go to ‘Settings’ of the plugin and click on the tab named ‘Combine’.
- Click ‘Save Changes’.
Using WP Super Minify Plugin
- Install a WordPress cache plugin, such as WP Rocket.
- Activate the plugin and go to its settings.
- Save the changes and clear any cache that may be stored on your website.
- Test your website’s performance using tools like GTmetrix or Google PageSpeed Insights.
Installing a Plugin such as Head & Footer Code
- Go to your WordPress dashboard and navigate to “Plugins” > “Add New”.
- Search for “Head & Footer Code” in the search bar.
- Click on the “Install Now” button next to the plugin.
- Once the installation is complete, click on the “Activate” button.
- Go to “Settings” > “Head & Footer Code”.
- Click on the “Save Changes” button to save your code.
Using Functions.php File
- Access your WordPress dashboard.
- Go to Appearance and click on Theme Editor.
- Look for the functions.php file in the list of theme files on the right – hand side.
- Open the functions.php file by clicking on it.
- Scroll down to find the closing PHP tag (?>) at the end of the file.
- Place your cursor right before the closing PHP tag.
- Save your changes by clicking on Update File.
This will allow you to restore your site easily if needed. Additionally, it’s important to have a staging site where you can test any changes before implementing them on your live site.
It’s also crucial to consider the file structure of your theme and child theme. Avoid modifying core files directly as this may cause conflicts with theme updates in the future. Instead, use functions.php file or create custom templates for specific pages or post types.
Using a Plugin
- Jetpack: Jetpack is a tool that offers benefits for WordPress sites, including protection, speed optimization, and growth features. You can use Jetpack to protect your site from threats, improve its loading speed, and enhance its functionality.
Utilizing WordPress Functions and Hooks
- Use a plugin: You can install a plugin like Code Snippets, which allows you to add custom code snippets using the admin area of your WordPress site. This is a user-friendly solution for non-technical users.
- Use WordPress functions and hooks: By utilizing functions.php file, you can enqueue scripts using the `wp_enqueue_script()` function within the `functions.php` file of your child theme. This will ensure that the script is loaded on specific pages or posts based on conditional logic using `is_page()` function.
Creating a Plugin
- Create a new folder in the wp – content/plugins directory of your WordPress installation.
- Inside the folder, create a new PHP file and open it with a text editor.
- Add the plugin header at the beginning of the PHP file. You can use the following code as a template:
- Save the PHP file and upload it to the wp – content/plugins directory using an FTP client or File Manager tool provided by your hosting provider.
- Go to the Plugins section in your WordPress admin area and activate your newly created plugin.