The best thing for what WP is known at the same time is the biggest headache, yes the plugins and large amount of unnecessary ressources on Front End, partly to blame themeforest and one theme to do it all.
In the development community, everyone already knows these things probably and might even ask “Why don’t you use VUE or Angular or other frameworks ?” . That might work for some creative nice looking dribbble websites but guess what on real life that shit is not working well. Based on my research and client requests they are more interested in a functional SEO Ready & fast website with low bounce rate & high conversion, at the end of the day is about ROI. Vue.js, Angular or React are not the best when it comes to SEO which is our core service at MIK Group. Let’s face it SEO is a crucial part of the website.
Down below you will find the thing I tackle on each and every project.
Plugins
Who in the earth needs 50+ plugins which one of my clients had, seriously who does that, the worst is the developer did it not the client himself.
My problem with WordPress plugins is that simple it is too much to handle each plugin ads a script and a CSS file at least if it has to do with the Front End.
Then, of course, it’s developer decides that needs to be updated due to security reasons or compatibility with the latest WP version and it is just fine.
However, on the other side, that becomes a problem wheZn you have a lot of plugins to update means you have to do it and then check if anything is broken which in most cases is and we all know how bad things can go. If you don’t update you come to the reason why I started this in the first place, getting hacked for not updating on time.
Updates
Updating your site is probably the most important thing. You have to update in order for the website to be healthy, prevent hacks and perform well which often are a cause of slow websites.
Problem is when you have a lot of plugins and after you update many things get rewritten or conflict with other plugins or directly with the site, remember you have to update them. a few years ago Revolution Slider had a huge vulnerability which caused millions of websites to go down. A big headache is for example for my team as we have 100+ clients using WP which all of them need to be maintained and is just too many resources to be channeled.
Solution:
Guess what? No plugins. Every single plugin is replaceable I did it you can do it.
Page Builders
OMFG I literally f..king hate this, well yes my Mom can do a website now with Visual Composer on her kitchen but is she solving any problem ? NOOOOO. I don’t even care if you agree with me Visual Composer and Revolution Slider are the most f..ked up plugins on earth. They tend to become very heavy and the back-end on some sites become useless . Let’s not talk for the front-end where we have a pile shit of CSS files and JS files with each extra module you install. Try and fix with that Above the fold or Page Speed optimization which BTW is a
ranking Factor on SEO since 2018. The only Page Builder that at all times was stable for me is the built-in Kallyas page builder.
Solution:
Use ACF which is good and visually appealing and easy to work with. If you wan’t to be my bro then use Meta Boxes , they really work great with WP and is the most stable solution out there. I can prove that with website old since 2012 and working just fine with latest WP Version. Static File CMS is another dimension and will talk in another article.
Security
It is a big deal to secure your website. It is mind blowing how many WP sites get hacked daily due to security reasons which most of the cases involve updates & unpached sources. What is funny is if you don’t build a diagnostic system which checks the health of the websites on regular based you might get hacked and not even noticing it. Most common cases hack your website by uploading a file which then adds on each post a script inside articles or pages, in late cases websites were being used for mining which infected visitors as well. Worst thing that can happen is to disappoint mother Google which can blacklist the website as a security threat and is hard to recover from that.
Solution:
iTheme Security if you still wanna use a plugin. My solution was to block entirely the WP – Admin and make it available to only 1 IP , change the wp-admin url, use hyper secure password, use non admin username , SSL and file permissions among them which we underestimate. Also great thing is to disable entirely the default comments , disqus or fb comments are good in this case.
Cleanup & Optimize
When you look at the source of a WP site you see 1000 meta tags on top for all sort’s of sh.t 30,000 css files and 4 milion .js files, which when you study the project well you can simply combine or remove. We need to optimize websites and above the fold so this is a important step.
Solution:
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'print_emoji_detection_script', 7 );
remove_action('admin_print_scripts', 'print_emoji_detection_script' );
remove_action('wp_print_styles', 'print_emoji_styles' );
remove_action('admin_print_styles', 'print_emoji_styles' );
remove_action('wp_head', 'rel_canonical');
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('wp_head', 'rest_output_link_wp_head' );
remove_action('wp_head', 'wp_oembed_add_discovery_links' );
remove_action('template_redirect', 'rest_output_link_header', 11, 0 );
Add it to your functions.phg and see by your self what happens. Also the Menu from WP can become a large peace of HTML with no reason while you can just call the menu links directly and not use all those classes that get generated. As a final shot use JSMin php optimizer and include it as first file via functions.php to minify the code , BTW this is the best thing you can do when it comes to SEO Optimization.
Meta tags can be a big mess on top of the page but this is how you can fix that, dynamic , clean & what is absolutely necessary
<meta itemprop="image" content="<?php $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $previous_post->ID ), "Full"); echo $imgsrc[0]; ?>">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@astritmalsija">
<meta name="twitter:title" content="<?php echo wp_title('- Astrit',true,'right'); ?>">
<meta name="twitter:description" content="<?php echo $meta = get_post_meta($post->ID, 'seo_description', true ); ?>">
<meta name="twitter:creator" content="@astritmalsija">
<meta name="twitter:image:src" content="<?php $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $previous_post->ID ), "Full"); echo $imgsrc[0]; ?>">
<meta property="og:title" content="<?php echo wp_title('- Astrit',true,'right'); ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php echo the_permalink(); ?>" />
<meta property="og:image" content="<?php $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $previous_post->ID ), "Full"); echo $imgsrc[0]; ?>" />
<meta property="og:description" content="<?php echo $meta = get_post_meta($post->ID, 'seo_description', true ); ?>" />
<meta property="og:site_name" content="Astrit" />
<meta property="article:section" content="Blog" />
<meta property="article:tag" content="<?php echo $meta = get_post_meta($post->ID, 'seo_keywords', true ); ?>" />
Mobile Site
According to Google the best optimized content is the one that doesn’t show at all. I stay behind that 100%. Google started to make a ranking factor the page speed and we of course that to increase those conversions right ? Oh and by the way mobile has surpassed desktop with users so we are talking about a bright future. The performance might be there to support our fancy website but the screen and internet connection is not there yet.
Solution:
Test your website with a low tier network ( easy on chrome F12) . Create a mobile device identifier and then show css, js and content only for mobile which makes the website way lighter and fast loading. A good mobile site must load inside of a second at least above the fold section. A mobile site must have clickable areas at least 80 x 80px. You can test my site I have different source on mobile and different on desktop but is dynamic and the very same content which doesn’t confuse Google
Enque
I came to a conslusion that is much better to keep some separate files for speciall ocasions for example let’s say we have a portfolio and a fancy slider which is needed only on portfolio , why do you wanna load it on all the pages where is not going to be used .
Solution:
Enque the scripts and styles using loops on functions.php and call the script to a specific page or device for example you can exclude from Kontakt Page and Mobile . I promise you won’t have any problem
if(isMobile()){
wp_enqueue_script( '01', URL . 'js/mobile-script.js', array(), null, true );
} else {
wp_enqueue_script( '02', URL . 'js/main-script.js', array(), null, true );
if (is_page( '8' ) ) {
wp_enqueue_script( '03', URL . 'js/secondary-script.js', array(), null, true );
}
}
Bonus: Trailing Slash /
The slash on the end of the url returns with a 301 status if you check network on Google DevTools and by definition
301 Status is a permanent redirect so this ads up time to your page and looks ugly. To remove that easily without hassle and not through .htaccess just go to Settings > Permalinks > Custom Structure and remove the slash from /%postname% .
Thanks for reading.