{"id":16991,"date":"2021-01-12T09:37:26","date_gmt":"2021-01-12T14:37:26","guid":{"rendered":"https:\/\/www.knownhost.com\/blog\/?p=16991"},"modified":"2021-01-12T09:39:46","modified_gmt":"2021-01-12T14:39:46","slug":"how-to-produce-cleaner-code-on-your-site-part-2","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/","title":{"rendered":"How to Produce Cleaner Code on Your Site &#8211; Part Two"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>Updated January 12, 2021<\/strong><\/h3>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>In <a href=\"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-part-one\/\">Part 1<\/a>, we covered 15 things you can do to help your site get more clean, lean and secure for improving user satisfaction and search engine rankings.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>In Part 2, we&#8217;ve got another set of tasks that you can move ahead with, each of which will help get your site cleaned up and performing at its peak.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Remember to make a site backup and download it for safekeeping before making major changes to your hosting environment, platform, themes, plugins or files.  This is not an overcautious suggestion &#8211; it&#8217;s a smart move!<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Cleaner and Leaner Code Tasks (Part 2)<\/strong><\/h2>\n\n\n<p>The tasks below won&#8217;t apply to every type of website or web hosting account, but are presented for the benefit of many SME site owners.  If one doesn&#8217;t apply to you, then go on to the next.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PHP Version<\/strong><\/h2>\n\n\n<p>PHP: Hypertext Preprocessor is a server scripting language that enables web developers to create dynamic sites using HTML.  With regular version updates, over time PHP becomes more secure, more feature filled and faster.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>PHP Task &#8211; Switch to a Newer Supported PHP Version (7.4)<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Login to WordPress Admin, click Tools -&gt; Site Health.  Click the Info tab and click the Server section. Check the PHP Version.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>If you&#8217;re not seeing 7.4.x  (a 7.4 variant), then you&#8217;ll want to consider upgrading \/ switching versions.  First, update your WordPress, theme(s) and plugins to their latest versions.  Clear cache, make a site backup, download and save somewhere safe.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Login to cPanel, then in the Software section, look for the Select PHP Version icon.  It&#8217;s here that you can select, via dropdown, alternative PHP versions.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>If you don&#8217;t see 7.4 in the list, then your web hosting provider may not yet be ready to roll it out to customers.  It&#8217;s at this point you&#8217;d want to check with technical support to find out when and possibly why it&#8217;s not yet available.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>As soon as you switch PHP versions, check your site to confirm everything is working.  Browse the site as a regular user.  Login to the admin area, test it out and make sure everything is behaving properly.  Check Site Health and see what it&#8217;s reporting.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Spam and Trash Comments<\/strong><\/h2>\n\n\n<p>Cleaner code means keeping the database clean as well as the filesystem.  With WordPress, if you&#8217;ve left the site open, allowing comments, it could be that you&#8217;ve been inundated with unwanted comments.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>If you&#8217;ve kept on top of things and flagged comments as spam or trashed them, they are still cluttering up the database.  Cleaning them out will help your WordPress function optimally.  If you haven&#8217;t kept on top of the comments, you might just have a ton of pending comments that haven&#8217;t yet been flagged as spam, or trashed.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Cleanup of spam, trash and pending comments can be done with a plugin or manually using SQL statements.  Make a backup before proceeding.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Comments Task &#8211; Clean up Spam, Trash (and possibly Pending)<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p><strong>Method A &#8211; SQL<\/strong><\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Login to cPanel and launch phpMyAdmin.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Delete Pending Comments (only if there are many unwanted)<br>\nDELETE from wp_comments WHERE comment_approved =  &#8216;0&#8217;;<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Deleting Flagged Spam Comments<br>\nDELETE from wp_comments WHERE comment_approved = &#8216;spam&#8217;;<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Deleting Trashed Comments<br>\nDELETE from wp_comments WHERE comment_approved = &#8216;trash&#8217;;<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p><strong>Method B &#8211; Plugin<\/strong><\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Install and activate <a href=\"https:\/\/wordpress.org\/plugins\/wp-bulk-delete\/\">WP Bulk Delete<\/a> plugin.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Select the comment status you want deleted, such as all Spam comments and delete.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Disable Pingbacks and Trackbacks<\/strong><\/h2>\n\n\n<p>Frequently a source of SEO spam, pingbacks and trackbacks do have a purpose, but can quickly get out of hand, placing unnecessary loads on the database as their numbers rise.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Link Notifications Task &#8211; Disable Pingbacks and Trackbacks<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Login to the WordPress Admin area.  Click Settings -&gt; Discussion.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Deselect the option to allow link notifications from other blocks (pingbacks and trackbacks).<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Reduce Post Revision History<\/strong><\/h2>\n\n\n<p>Being able to rollback a post to a prior version is handy if you&#8217;ve been making substantial edits and they didn&#8217;t go according to plan.  But how many copies of the post does it make sense to save?  3?  5?  10?  The default behavior for WordPress is an unlimited number of revisions!<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>By specifying the number of post revisions to retain, the WordPress database can be kept svelte and speedy.  You may even want to remove the existing revisions, if you&#8217;re satisfied with the posts you&#8217;ve finished.  The removal is beneficial, but optional, in case you&#8217;d like to keep some post history for further editing.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p><strong>Revision History Task #1 &#8211; Limit the Number of Revisions Retained<\/strong><br>\nEdit the wp-config.php file by adding the following line, changing the number 5 to be whatever number of revisions you&#8217;d actually like to keep for each post.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>define( &#8216;WP_POST_REVISIONS&#8217;, 5 );<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p><strong>Revision History Task #2 &#8211; Delete Existing Post Revisions (optional)<\/strong><br>\nLogin to cPanel and launch phpMyAdmin.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>DELETE FROM wp_posts WHERE post_type = &#8216;revision&#8217;;<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Note:  This assumes that your prefix is &#8220;wp_&#8221;.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Reduce Trash Auto Cleanup Interval<\/strong><\/h2>\n\n\n<p>When you trash posts they go into a recycling bin of sorts for a default period of 30 days.  That means every post you set as status &#8220;trash&#8221; will still stick around for 30 days before WordPress automatically performs cleanup.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>There is a constant that can be set in the wp-config.php file which determines how many days will pass before a trashed post is cleaned.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Trash Auto Cleanup Task &#8211; Reduce Trash Cleanup Interval<\/strong><\/h2>\n\n\n<p>Make a copy for safekeeping of your wp-config.php file, just in case.  Then edit the file by inserting a new line (assuming a similar line isn&#8217;t already present), such as:<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>define(&#8216;EMPTY_TRASH_DAYS&#8217;, 3);<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>In this example the trash cleanup interval will be reduced from 30 days to 3 days, giving you much less time to change your mind, but also giving you much less trash just hanging about waiting to be auto cleaned.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Cull the Herd of Low Quality Posts<\/strong><\/h2>\n\n\n<p>Over time you&#8217;ll likely find that a small number of posts bring in the majority of traffic to the site while a sizable number of them are bringing in little to nothing.  This could be because the content is thin (few words on the page), doesn&#8217;t contribute anything new or of value (similar to other pages in the index), competes with other pages on site (by being too similar), hasn&#8217;t been optimized for keywords that have decent search volumes or just doesn&#8217;t fit any common search intent very well.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>In cases where you&#8217;ve got content that isn&#8217;t ranking well and bringing in traffic, you can reduce the database size and disk storage with a bit of housekeeping.  In this case, you can completely remove the post(s), making note of their current URLs and then redirecting those URLs to other related content that could benefit from a bit of internal linking.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Low Quality Post Cleanup Task &#8211; Remove and Redirect<\/strong><\/h3>\n\n\n<p>Check your Google Analytics to see URLs that are indexed but getting little to no monthly search traffic (make a list).  Visit the posts and see if there are any easy wins where you could tweak, add a bit, optimize or differentiate and make them useful pages.  If not, then proceed with the steps.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Find related posts for each one and make note of where you&#8217;ll want to redirect each.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Purge the low quality \/ non-fixable posts.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Add the old URL and new destination URL into your <a href=\"https:\/\/wordpress.org\/plugins\/redirection\/\">Redirection<\/a> plugin and the redirect will be complete.<\/p>\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Note:  This is similar to the task relating to removal and redirecting of discontinued ecommerce products.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Remove and Redirect Discontinued Products<\/strong><\/h2>\n\n\n<p>Some ecommerce sites have products that come and go, being sold out and never to return once they&#8217;re out of stock.  In these situations, rather than having landing pages where people can&#8217;t buy anything, the product pages should be redirected to active, similar products or offers.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Redirecting pages taps into the inherent value of the page, preserving any inbound or internal link juice the page may have acquired and passes it on to another page on site.  Over time, this can mean the site mass gets bigger even though the raw number of active pages at any one time doesn&#8217;t get inflated.  It&#8217;s good for SEO and the user experience, plus helps keep the database and filesystem clean and quick.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Keep in mind that redirecting the discontinued pages means more than just sold out \/ non-returning stock.  It also means redirecting special offer landing pages &#8211; especially those which were promoted plus had links and social shares pointing to them.  These pages have SEO value and shouldn&#8217;t just disappear off the map.  They could be repurposed in some cases, but there are only so many uses for things like special holiday deals from a year or two ago!<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Discontinued Product Page Cleanup Task &#8211; Removal \/ Redirection<\/strong><\/h3>\n\n\n<p>If the product isn&#8217;t coming back into stock then there&#8217;s little point keeping it in the active pages lingering about.  These are ideal for redirecting to active products or categories.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>WooCommerce has posted advice on redirecting and has said the <a href=\"https:\/\/woocommerce.com\/posts\/ecommerce-redirect-guide\/\">Redirection<\/a> plugin for WordPress is a recommended solution. There are other redirect plugins available, but with over 1,000,000 installs and many glowing reviews, this is a proven path to redirecting success.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>For SEO purposes, look to use permanent 301 redirects to notify search engines that the content is no longer at this location and instead can be found on the other product page on site. In order to get the maximum SEO benefit, you&#8217;ll want to redirect the old product page to <a href=\"https:\/\/moz.com\/blog\/301-redirection-rules-for-seo\">something very similar<\/a> content-wise. If the new destination is unrelated, then much of the passed authority will be diminished.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>If you&#8217;d like to speed up Google seeing this change so that your new product page gets traffic more quickly, login to Google Search Console and select the URL Inspection Tool.  Paste in your new product URL and select Request Indexing.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Note:  This is similar to the task relating to removal and redirecting of low quality or outdated content that is no longer relevant, correct or being updated.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Remove Unused Images \/ Clean Up the Media Library<\/strong><\/h2>\n\n\n<p>Ever upload a half dozen images then decide to use just one in a post?  It happens, a lot!  Combine this with the WordPress default behavior of making 3 different sized images for every upload (plus any created by other themes and plugins) and, over time, the filesystem and database suffer from the bloat.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Knowing which images to remove is much easier said than done.  There are images in the uploads folder(s) as well as references within the media library.  A proper cleanup means checking both against what&#8217;s actually needed and used within the site.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Image Cleanup Task &#8211; Remove Unused Images<\/strong><\/h3>\n\n\n<p>There are a number of good plugins that can be used to do part of the cleanup, but to get the filesystem and media library both, it&#8217;s likely that a premium version of the particular plugin will be required.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Look at specialist tools like <a href=\"https:\/\/wordpress.org\/plugins\/media-cleaner\/\">Media Cleaner<\/a> or multifunction tools like <a href=\"https:\/\/wordpress.org\/plugins\/wp-optimize\/\">WP-Optimize.<\/a><\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Offload Video (optionally Offload Images)<\/strong><\/h2>\n\n\n<p>If you&#8217;ve ever run your site through a page speed checker like GTmetrix, you&#8217;ve probably noticed the number of images your pages have and the file size of any videos.  Rather than keeping all these files on your web hosting account, it&#8217;s possible to offload them to another site and embed them in your pages.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>The obvious advantage is the space savings for your hosting.  When it comes to video, by offloading to YouTube you get an expanded audience, effectively giving you free marketing for your content.  By having the content on YouTube, you&#8217;ll get found when people search on there, plus you get the social aspects that go with it such as comments, shares, and so on.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p><strong>Video Cleanup Task &#8211; Consider Offloading Video to YouTube<\/strong><br>\nVideo from many different sites can be directly embedded in blog posts and widgets without need for a special plugin.  However, there are some very cool features that video embed plugins bring to the table.  It&#8217;s all down to how you intend to display the video content.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p><strong>Image Cleanup Task &#8211; Consider Offloading Images to Google Photos<\/strong><br>\nVideo from many different sites can be directly embedded in blog posts and widgets<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Logging and Log Files<\/strong><\/h2>\n\n\n<p>Server statistics are information you can use to manage your account.  But do you need to preserve historical information forever?  Do you need 3 different logging services running?<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Error logs give you insights into what&#8217;s going wrong with the server and the software running.  Having a regular look at the error log and dealing with errors promptly is a part of having a server.  Why keep those error logs around, especially older errors and ones you&#8217;ve already handled?<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Logging Cleanup Task #1 &#8211; Error Logs<\/strong><\/h3>\n\n\n<p>Login to cPanel, click on Metrics and then Errors.  Deal with the errors and clean out the log file.  If you&#8217;re using File Manager or FTP, have a look in the \/tmp\/ folder for log files.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Logging Cleanup Task #2 &#8211; Archived Access Logs<\/strong><\/h3>\n\n\n<p>Within cPanel, click on Metrics and then Raw Access.  To automatically remove archived logs from the month prior, tick the Remove Previous Month and click Save.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Logging Cleanup Task #3 &#8211; Choose Less Statistics Logging<\/strong><\/h3>\n\n\n<p>Within cPanel, click on Metrics and then Metrics Editor.  Untick whichever of the logging software you can do without (you can have any or all, it&#8217;s up to you) and then click Save.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>By having less monitoring and logging, you&#8217;ll lighten the load in more ways than one.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Cleaning and Optimization Plugins and Tools<\/strong><\/h2>\n\n\n<p>There are so many different WordPress specialty tools, it&#8217;s hard to single out just one. But for database optimization, there are plugins like <a href=\"https:\/\/wordpress.org\/plugins\/wp-optimize\/\">WP Optimize<\/a> and <a href=\"https:\/\/wordpress.org\/plugins\/wp-sweep\/\">WP Sweep<\/a>.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Multifaceted cleanup tools such as <a href=\"https:\/\/wordpress.org\/plugins\/wp-asset-clean-up\/\">WP Asset Clean Up<\/a> and <a href=\"https:\/\/wordpress.org\/plugins\/autoptimize\/\">Autoptimize<\/a> are popular because they do so much.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>Premium multifunction tools have an incredible range of features and work to improve performance through cleanup and optimization. These include <a href=\"https:\/\/perfmatters.io\">Perfmatters<\/a> and <a href=\"https:\/\/flying-press.com\/\">FlyingPress<\/a>. If you want clean, lean, ultrafast site performance, have a look at both (though you wouldn&#8217;t need both &#8211; it&#8217;s more of an either\/or).<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n<p>Keeping your hosting account and web pages clean and lean is a sure fire way of getting even better performance out of your server, delivering pages faster and keeping site visitors happily sticking around.<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<p>If you&#8217;d like even more technical tips, such as how to remove unused CSS and JS, plus how to minify and compress your code, drop a comment or email to our team.  We&#8217;ll be happy to take a deep dive with you!<\/p>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Updated January 12, 2021 In Part 1, we covered 15 things you can do to help your site get more clean, lean and secure for improving user satisfaction and search engine rankings. In Part 2, we&#8217;ve got another set of tasks that you can move ahead with, each of which will help get your site [&hellip;]<\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[2422,2311],"class_list":["post-16991","post","type-post","status-publish","format-standard","hentry","category-internet","tag-cleaner-code","tag-coding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Produce Cleaner Code on Your Site - Part Two - KnownHost<\/title>\n<meta name=\"description\" content=\"In Part 1, we covered things you can do to help your site get more clean, lean and secure. Read on to continue making efficient code changes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Produce Cleaner Code on Your Site - Part Two - KnownHost\" \/>\n<meta property=\"og:description\" content=\"In Part 1, we covered things you can do to help your site get more clean, lean and secure. Read on to continue making efficient code changes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/KnownHost\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-12T14:37:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-12T14:39:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.knownhost.com\/blog\/wp-content\/uploads\/2021\/01\/code.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"682\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Emily Moore\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@KnownHost\" \/>\n<meta name=\"twitter:site\" content=\"@KnownHost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Emily Moore\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/\"},\"author\":{\"name\":\"Emily Moore\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#\\\/schema\\\/person\\\/b15716b5af83cfb7bfd5bd13ecf985fc\"},\"headline\":\"How to Produce Cleaner Code on Your Site &#8211; Part Two\",\"datePublished\":\"2021-01-12T14:37:26+00:00\",\"dateModified\":\"2021-01-12T14:39:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/\"},\"wordCount\":2413,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#organization\"},\"keywords\":[\"cleaner code\",\"coding\"],\"articleSection\":[\"Internet\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/\",\"name\":\"How to Produce Cleaner Code on Your Site - Part Two - KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-01-12T14:37:26+00:00\",\"dateModified\":\"2021-01-12T14:39:46+00:00\",\"description\":\"In Part 1, we covered things you can do to help your site get more clean, lean and secure. Read on to continue making efficient code changes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/how-to-produce-cleaner-code-on-your-site-part-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Produce Cleaner Code on Your Site &#8211; Part Two\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/\",\"name\":\"KnownHost.com\",\"description\":\"Quality Managed Web Hosting by KnownHost\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#organization\",\"name\":\"KnownHost, LLC\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/logo.png\",\"width\":1200,\"height\":400,\"caption\":\"KnownHost, LLC\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/KnownHost\\\/\",\"https:\\\/\\\/x.com\\\/KnownHost\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/knownhost\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/#\\\/schema\\\/person\\\/b15716b5af83cfb7bfd5bd13ecf985fc\",\"name\":\"Emily Moore\",\"sameAs\":[\"https:\\\/\\\/www.knownhost.com\"],\"url\":\"https:\\\/\\\/www.knownhost.com\\\/blog\\\/author\\\/emily-honeycutt\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Produce Cleaner Code on Your Site - Part Two - KnownHost","description":"In Part 1, we covered things you can do to help your site get more clean, lean and secure. Read on to continue making efficient code changes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/","og_locale":"en_US","og_type":"article","og_title":"How to Produce Cleaner Code on Your Site - Part Two - KnownHost","og_description":"In Part 1, we covered things you can do to help your site get more clean, lean and secure. Read on to continue making efficient code changes.","og_url":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/","og_site_name":"KnownHost","article_publisher":"https:\/\/www.facebook.com\/KnownHost\/","article_published_time":"2021-01-12T14:37:26+00:00","article_modified_time":"2021-01-12T14:39:46+00:00","og_image":[{"width":1200,"height":682,"url":"https:\/\/www.knownhost.com\/blog\/wp-content\/uploads\/2021\/01\/code.png","type":"image\/png"}],"author":"Emily Moore","twitter_card":"summary_large_image","twitter_creator":"@KnownHost","twitter_site":"@KnownHost","twitter_misc":{"Written by":"Emily Moore","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/"},"author":{"name":"Emily Moore","@id":"https:\/\/www.knownhost.com\/blog\/#\/schema\/person\/b15716b5af83cfb7bfd5bd13ecf985fc"},"headline":"How to Produce Cleaner Code on Your Site &#8211; Part Two","datePublished":"2021-01-12T14:37:26+00:00","dateModified":"2021-01-12T14:39:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/"},"wordCount":2413,"commentCount":1,"publisher":{"@id":"https:\/\/www.knownhost.com\/blog\/#organization"},"keywords":["cleaner code","coding"],"articleSection":["Internet"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/","url":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/","name":"How to Produce Cleaner Code on Your Site - Part Two - KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/blog\/#website"},"datePublished":"2021-01-12T14:37:26+00:00","dateModified":"2021-01-12T14:39:46+00:00","description":"In Part 1, we covered things you can do to help your site get more clean, lean and secure. Read on to continue making efficient code changes.","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/blog\/how-to-produce-cleaner-code-on-your-site-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Produce Cleaner Code on Your Site &#8211; Part Two"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/blog\/#website","url":"https:\/\/www.knownhost.com\/blog\/","name":"KnownHost.com","description":"Quality Managed Web Hosting by KnownHost","publisher":{"@id":"https:\/\/www.knownhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.knownhost.com\/blog\/#organization","name":"KnownHost, LLC","url":"https:\/\/www.knownhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knownhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.knownhost.com\/blog\/wp-content\/uploads\/2021\/04\/logo.png","contentUrl":"https:\/\/www.knownhost.com\/blog\/wp-content\/uploads\/2021\/04\/logo.png","width":1200,"height":400,"caption":"KnownHost, LLC"},"image":{"@id":"https:\/\/www.knownhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/KnownHost\/","https:\/\/x.com\/KnownHost","https:\/\/www.linkedin.com\/company\/knownhost"]},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/blog\/#\/schema\/person\/b15716b5af83cfb7bfd5bd13ecf985fc","name":"Emily Moore","sameAs":["https:\/\/www.knownhost.com"],"url":"https:\/\/www.knownhost.com\/blog\/author\/emily-honeycutt\/"}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/posts\/16991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/comments?post=16991"}],"version-history":[{"count":0,"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/posts\/16991\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/media?parent=16991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/categories?post=16991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/blog\/wp-json\/wp\/v2\/tags?post=16991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}