As on Jan-22, nearly 40% of the total websites are built using the WordPress platform. If you’re one of them then you must read this blog post.
This blog post will tell you how to optimize and make your WordPress website ready for online.
It will suggest a few changes to your WordPress website to be further optimized and make it faster.
- Changes for WordPress Optimization
- 1. Use Light Weight WordPress themes
- 2 Change Permalink Setting in WordPress
- 3. Google XML Sitemap
- 4. SEO Changes to WordPress
- a. Installing Cache Plugin
- b. Installing SEO Plugin
- c. Generate HTML sitemap for WordPress Blog
- d. Defer Javascript Files
- E. Avoid Internal Duplicate Content
- F. Disable Emoji and Embeds in WordPress
- G. Disable pingbacks and trackbacks
- 5. Reduce the number of plugins installed
- 6. Improve Site Speed
- Pro Tip
- Over to you
Changes for WordPress Optimization
Assuming you already had a WordPress site installed with the default theme and settings available. This blog post will share what all changes (from simple to advance levels) you should implement to make your WordPress blog great and SEO Optimized.
Starting from installing a new lightweight theme to updating the function.php file to make the WordPress site faster. The below article includes everything.
After implementing these changes, I am sure your website will be ready to rank higher in the search engine and attract more visitors to it.
So, What’re we waiting for? Let’s discuss those changes below in detail.
1. Use Light Weight WordPress themes
This is the very first thing you should change immediately after installing WordPress on your blog.
Change the default one to any lightweight theme of your choice like Astra, Neve, Ocena WP, Generate Press, etc.
As far as the theme is properly coded and is from a well-known designer there is no harm in installing it.
Please do not select a theme with lots of features or options available. We do not want to install all of them. So instead, select a theme that is light and properly coded.
You can check out the below article for the best WordPress themes for beginners.
The Header, Footer, Sidebar, and blog post layout (Grid and List Layout) is enough for any WordPress theme.
Please don’t look beyond it. Features like Colors, Recent posts, and Social Media accounts can be installed using Gutenberg now.
Today by default Gutenberg is available in WordPress installation and you can use this for designing your blog.
Never use any Page Builder plugin to design your site. Reasons for the same are :- a) Now, even a default Gutenberg can do this easily b) Such plugins are too expensive and c) Once you un-install the same in future, your entire site will get break down.
2 Change Permalink Setting in WordPress
Permalink in WordPress is the permanent URL structure of the webpage. It will decide how the URL will appear on your blog.
Whether the URL should include the ‘Category Name’ or not, will be decided by this Permalink structure.
You can change this in the WordPress through ‘Permalink’ option available under the ‘Setting’ on the left sidebar.
By default, WordPress uses the post ID number in its Permalink structure. This is completely fictional and not easy to remember and understand.
Hence, it should be changed immediately after installing WordPress. Based on your blogging niche, you should select the best permalink structure for your blog.
If your blog is about ‘Current News’ then you should change permalinks to ‘Day and Name’. For others ‘Post Name’ is the best URL structure.
3. Google XML Sitemap
The third change in the list is installing Google XML sitemap. This sitemap will help Search Engines including Google to easily find all web pages of your blog.
There are many sitemap plugins available online. However, you will not need them if you’re already using any SEO plugin like Yoast SEO on your blog.
By default, such plugins have a Google XML sitemap generation option available in it.
Besides simply installing an SEO sitemap, it is also important to submit this sitemap to all Search Engine Webmaster accounts.
Adding a sitemap to webmaster accounts can help you to identify crawl errors (if any) in your sitemap.
Both generating sitemap and adding it to the webmaster account is a one-time activity. It will get updated automatically whenever you add, change or delete any post on your blog.
4. SEO Changes to WordPress
If you’re under the assumption that WordPress has the best possible SEO options available then you’re wrong.
By default, WordPress is not SEO friendly.
You need to make the following changes to WordPress for making it SEO friendly and faster.
a. Installing Cache Plugin
This is the very first thing you will require to make WordPress faster. Without this plugin, your website would have to download your web pages every single time when your visitors visit your site.
Thanks to the cache plugin, it will help the browser cache everything and ensure users returning to visit your web pages will be able to access your content faster.
b. Installing SEO Plugin
Whether you are a beginner or an expert in Search Engine Optimization, the SEO plugin is a must for you.
The reason for the same is very simple.
By default, there is no option to add different Meta Descriptions to different posts in WordPress.
Moreover, the SEO plugin will also allow you to make web pages ‘Non-Indexable’ to avoid any internal duplicate content problems.
In short, besides improving the content, this plugin also helps with many additional SEO changes to your site.
For Example, Generating XML sitemap, Adding Schema, Crawl Setting, Search Appearance, Breadcrumbs, Sitemap, Social Profiles, etc.
These all changes can be made by simply installing one SEO plugin on your site.
c. Generate HTML sitemap for WordPress Blog
XML sitemap will help Search Engines to find and understand all webpages on your blog easily.
However, your visitors being a human can’t read it. Here, the role of the HTML sitemap will come.
The HTML sitemap in SEO will list all web pages together. And, this will make site navigation easier for your visitors.
Obviously, good site navigation is considered a plus sign for SEO. Hence, besides improving user experience, it will also boost your SEO scores online.
This is how it looks.
Wondering, how to add such a kind of sitemap to your WordPress blog?
No Problem, I will help you.
Simply, add the below code to your function.php file and mention the shortcode [htmlsitemap] on the webpage where you want to show the sitemap.
/** HTML Sitemap
/*
Put the following code in your themes functions.php file
*/
function get_html_sitemap( $atts ){
$return = '';
$args = array('public'=>1);
// If you would like to ignore some post types just add them to the array below
$ignoreposttypes = array('attachment');
$post_types = get_post_types( $args, 'objects' );
foreach ( $post_types as $post_type ) {
if( !in_array($post_type->name,$ignoreposttypes)){
$return .= '<h2>' . $post_type->labels->name.'</h2>';
$args = array(
'posts_per_page' => -1,
'post_type' => $post_type->name,
'post_status' => 'publish'
);
$posts_array = get_posts( $args );
$return .= '<ul>';
foreach($posts_array as $pst){
$return .= '<li><a href="'.get_permalink($pst->ID).'">'.$pst->post_title.'</a></li>';
}
$return .= '</ul>';
}
}
return $return;
}
add_shortcode( 'htmlSitemap', 'get_html_sitemap' );
In my case, I had created a new page with the shortcut [htmlsitemap] in it. That’s it. The above code list all my posts on the given page.
d. Defer Javascript Files
Defer js is a great way to improve the loading speed of your WordPress blog. This will also improve the Core Web Vitals of your site online.
All you need to do is add the below code to the function.php file. Yes, that’s it. The below code will defer and async javascript files on your blog.
/** Defer Javascript
/* Add this code to defer Javascripts for improving loading speed
*/
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
function defer_parsing_of_js( $url ) {
if ( is_user_logged_in() ) return $url; //don't break WP Admin
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );
function move_javascripts() {
remove_action( 'wp_head', 'wp_enqueue_scripts', 1 );
add_action( 'wp_footer', 'wp_enqueue_scripts', 5 );
}
Obviously, like Javascript, it is good to defer CSS files.
However, I had intentionally not done the same because deferring CSS files broke my WordPress theme and also increase the cumulative layout shift score of my blog.
Hence, I only defer javascript files on my blog.
E. Avoid Internal Duplicate Content
When it comes to Search Engines, every individual URL is unique to it. So, if you are showing the same content on two different URLs then it is considered to be duplicate for the Search Engine.
I know you will not do this intentionally. However, this happens in WordPress usually.
In WordPress, the same content is available on multiple URLs. For example, you will find the same content on the Post, Category, and Archive page as well.
To resolve this problem, you need to set the Category and Archive page to ‘Non-Indexable’ for the search engine.
This can be easily done using an SEO plugin installed on your blog.
F. Disable Emoji and Embeds in WordPress
One of the easiest ways to improve the loading speed of your WordPress blog is to disable emojis and embeds.
By default, WordPress load these javascript on all webpages. However, normally these are not required.
Disabling these scripts will optimize the loading speed of your blog a lot.
G. Disable pingbacks and trackbacks
A pingback is one type of comment that is created when you link back to another blog post.
Whereas, a trackback is a message sent to the website when it has been mentioned to from another blog post.
This sounds pretty good. Right? But, it also has many downsides.
One of the biggest demerits of using Pingbacks and Trackbacks is that they can be used for sending lots of spam to your website. Spammers can use them to get their links posted on as much content as possible.
Hence, it is strongly advisable to disable Pingbacks and trackbacks on your WordPress blog.
You will find this option in the ‘Discussion’ under the ‘Setting’ option available in the left sidebar.
5. Reduce the number of plugins installed
On every new plugin installation, your WordPress database size will get heavier and this will further impact the loading speed of your website online.
Though there is no ideal answer to the question that how many plugins are too many? It is highly advisable that you should keep the number of plugins to a minimum for better results.
Try to replace the single-use plugin with another having multiple uses.
For example, you can remove the sitemap plugin and replace the same with an SEO plugin capable of doing both things.
Similarly, you can remove the Social Media Sharing plugin and replace the same with Gutenberg blocks.
For your information, I am using only 7 plugins on my blog. And, even I am planning to remove a few of them in the near future.
6. Improve Site Speed
Initially, the page speed will be good. But after installing plugins to your site and adding a few blog posts, you will start finding a declining loading speed of your site.
It is very important to improve the page load time for ranking higher in the search engine. I had a detailed blog post written on ‘Boost Website Speed’. You will find the same below at the given link.
Pro Tip
Do not forget to check out the below article for more details on making your WordPress site more SEO friendly
Over to you
I strongly recommended making the above 6 changes to your WordPress blog immediately to get a higher Google Search Engine Ranking.
Feel free to leave a message in the below comment box in case you need any help in making the above changes on your site. I will be happy to help you.
But, in no case please go by the default setting of the WordPress blog. The default WordPress is not SEO friendly and it is not going to help you anywhere.
Of course, you can make changes to your WordPress blog anytime. No matter whether you had just started the blog or planning to start the blog, the above changes can be made anytime.
Just do not forget to remove the ‘Cache’, post making the above changes to see results.