Category: Code Snippets
-

Disable Automatic Compression of JPG in WordPress
[ad_1] WordPress has built in compression for JPG images. Whenever you upload an JPG/JPEG image to WordPress media library, WordPress will automatically compress your images to 90% of the original quality, this is intended to help your pages load faster and keep file sizes smaller. But sometime it’s essential to have high quality images on…
-

Add Async And Defer Attributes to JavaScript Elements
[ad_1] Add Async And Defer Attributes to JavaScript Elements – WordPress Code Snippets Categories Select categoryCategoriesCommentsFunctionsMediaOptimization & Best PracticePosts & pagesRSS FeedsSearchSecurityShortcodeSocial MediaThemesWidgetsWooCommerceWordPress AdminWordPress Config Add Async And Defer Attributes to JavaScript Elements closing tag of the Web page. The main reason for that is that script elements are fetched and executed immediately when the…
-

Display Custom Message on WordPress Login Page
[ad_1] You can display your own custom message on the WordPress login form by using the filter login_message. This is a great trick if you’re working on a client’s project or have a multi author blog. You can add a welcome message for your users or give them important information/instruction about the admin section or…
-

Change Footer Branding in WordPress Admin Panel
[ad_1] If you are doing client work on a WordPress theme then it’s nice to put your brand in as many places as you can without affecting the design of the website. The WordPress dashboard footer is an ideal place to put your credential link. Copy the following snippet in your functions.php file to change…
-

Add Additional Contact Methods to User Profiles
[ad_1] By default WordPress allow authors to display some information about themselves, such as a website URL, email address, a short bio and their IM contacts, but it is missing important social media networks like Facebook, Twitter, linkedin and Google+. It’s good option to display social media profile page along with author bio because your…
-

Add Published Date & Last Modified Date in WordPress
[ad_1] Sometimes on a specific project, you have requirement to also display last modified date of pages and posts along with published date. So here is a code snippet to display both in your WordPress. Posted on <?php the_time( ‘F jS, Y’ ); ?> <?php // display last modified date $modified_time = get_the_time( ‘U’ );…
-

Change WordPress Logo on Login Page
[ad_1] WordPress provides their own logo on user registration and login pages but sometimes it is required to replace that with your/client logo especially for branding purpose. You can easily change the default WordPress logo on the Login page with the help of admin_head WordPress action. Here is a simple code snippet that will allow…
-

Batch Delete Spam Comments With Specific URL
[ad_1] Comment spammers are getting smarter and using latest techniques to fool anti-spam methods. It really does not matter which anti-spam plugins you use on WordPress, you must have noticed that these spam comments are bypassing your full proof system. Every now and then, you will receive bunch of spam comments on your website. If…
-

Change WordPress Post Autosave Settings
[ad_1] WordPress has a very useful feature which will automatically save your current draft every 30 seconds, as you type and you will not even notice. You can change the time interval settings on how often WordPress auto saves by adding a setting in the wp-config.php file. Let’s say you want to autosave drafts every…
-

Force Trailing Slash To Requested Urls
[ad_1] Although its personal preference whether you prefer trailing slash at the end of your website URLs or not. But if same webpage content on your website is accessible with two different URLs, one with trailing slash and other without it, then search engines consider it as duplicate content and therefore penalize your website domain…