At the moment, something like Display Featured Image In Post List is good.
Quick Featured Images is also good.
At the moment, something like Display Featured Image In Post List is good.
Quick Featured Images is also good.
After installing a plugin called “LightStart”, the tab display of Cocoon’s index disappeared. After checking the WP admin screen, settings, display settings, and checking that it is set to “Latest Posts” and saving again, the tabs are now displayed.
It’s a good idea to turn on “Completely block access to XML-RPC” in the All In One WP Security plugin. This will prevent spammy logins related to logins via XMLRPC.
Additionally, you can prevent brute force login attacks by enabling the login lockdown feature using the same All In One WP Security plugin.
The steps to increase the upload limit are as follows.
You can increase the upload size limit by editing the functions.php file. For example, to increase it to 10MB, add the following code to your functions.php file:
function bbp_cover_image_file_size( $fileupload_maxk, $type ) {
if ( 'avatar' == $type ) {
$fileupload_maxk = 10485760; // 10MB in bytes
}
if ( 'cover_image' == $type ) {
$fileupload_maxk = 10485760; // 10MB in bytes
}
return $fileupload_maxk;
}
add_filter( 'bp_attachments_get_max_upload_file_size', 'bbp_cover_image_file_size', 10, 2 );
This code increases the upload limit for both avatars and cover images to 10MB. It also works by pasting it in the WpCode Lite plugin and saving it.
By putting the following code in functions.php, you can load WordPress JS asynchronously. Effective if jquery.js or jquery-migrate.min.js appears in “Exclude resources that prevent rendering” in PageSpeed Insights.
if ( !(is_admin() ) ) {
function replace_scripttag ( $tag ) {
if ( !preg_match( '/\b(defer|async)\b/', $tag ) ) {
return str_replace( "type='text/javascript'", 'async', $tag );
}
return $tag;
}
add_filter( 'script_loader_tag', 'replace_scripttag' );
}
However, if I do this, my PageSpeed Insights score will go up, but the Cocoon blog card image won’t display properly, so I changed it back.
If you install Rank Math SEO, it won’t jump to the date archive, so if you want to change that, you’ll need to change the settings. To do this, enable date archiving in Titles & Meta, Misc Pages tab in Rank Math SEO.
I am creating a contact form using Contact Form 7. I use Recaptcha to prevent spam, but because of this, Recaptcha.js always comes up in Pagespeed Insights in “Eliminate render-blocking resources” or in “Reduce unused JavaScript”. Therefore, I researched and implemented a method to prevent Recaptcha.js from loading on pages other than the contact page. Try putting the following code in functions.php.
function block_recaptcha_badge() {
if ( !is_page( array( 'contact-me' ) ) ) {
wp_dequeue_script( 'google-recaptcha' );
wp_deregister_script( 'google-recaptcha' );
add_filter( 'wpcf7_load_js', '__return_false' );
add_filter( 'wpcf7_load_css', '__return_false' );
}
}
add_action( 'wp_print_scripts', 'block_recaptcha_badge' );
If you have multiple contact form pages, you can increase the array(‘contact-me’ part, like below.
array( ‘contact-me’, ‘contact-me’, ‘contact-me-3’
Today I will show you how to lazy load Adsense to increase site loading speed. First, if you have auto ads turned on, turn them off from the Google Adsense page. After that, go to your own site and paste the following code in the ad code of the ad tab of Cocoon settings, so let’s change that.
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456"
crossorigin="anonymous"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Delete <script> to </script> from at the top of this and make it look like the following.
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Save it.
Next, go to the access analysis/authentication tab in Cocoon settings, enter the following code in the footer code, and save.
<script>
//<![CDATA[
//lazy load ads
var lazyloadads = false;
window.addEventListener("scroll", function() {
if ((document.documentElement.scrollTop != 0 && lazyloadads === false) || (document.body.scrollTop != 0 && lazyloadads === false)) {
(function() {
var ad = document.createElement('script');
ad.type = 'text/javascript';
ad.async = true;
ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
var sc = document.getElementsByTagName('script')[0];
sc.parentNode.insertBefore(ad, sc);
})();
lazyloadads = true;
}
}, true)
//]]>
</script>
Boost your WordPress site’s speed with these steps:
Fast sites lead to better user experience and higher SEO rankings.