Best Guide To Increase Newspaper Theme Speed

increase-newspaper-theme-speed

A newspaper theme is one of the popular themes developed by the Tagdiv Team. It is a WordPress theme that allows you to write blog posts and news in easy ways. It has a separate theme panel in which you can customize the theme fully. You can get a newspaper theme from Themeforest. It is necessary to increase newspaper theme speed.

Most Read: Increase Website Speed (Works for all websites)

No doubt, why the newspaper theme is much popular. Overall optimization of the newspaper theme is very good especially the newspaper X version. The newspaper theme has the premium plugins available which help you to increase the website speed.

In this article, I will provide you some simple ideas for increasing newspaper theme-based website speed.

I consider that you have installed a newspaper theme with good hosting.

1) Using Cache Plugins

Using cache plugins helps you to increase website speed. I would recommend two caching plugins: WP Super Cache(free) and WP Rocket(paid). Since WP Super Cache is recommended by tagDiv, you can use that with its default settings. You can also use APC full page cache if you have a lot of ram in the server.

WP Rocket also works nicely with the Newspaper theme. But it is paid. If you can not afford WP Rocket, then use WP super cache in a combination with Autoptimize. It has nearly the same features but WP Rocket has more features.

2) Using CDN like Cloudflare

Cloudflare provides free CDN and free SSL to us. It caches all the resources of our website from our hosting server and server them to visitors through their servers. Using, Cloudflare with a newspaper or other themes are the best idea as it helps our site from the DMCA attack as they increase newspaper theme speed.

I hope you have set up Cloudflare. If not, read this article: Setup Cloudflare In Your Blog

Use the settings given below in Cloudflare. Wrong Settings might damage your website.

Under the Speed option, go to the optimization tab.

Under the auto minify option, select javascript, CSS, and HTML.

Minify Cloudflare

Enable Brotli compression under brotli option. If you have enabled brotli, no need to enable gzip compression.

Disable Rocket Loader as it affects the newspaper theme. So disabling is the best idea.

Rocketloader

3) Adding Expires Headers( Leverage Browsing Cache)

After setting expires headers, visitors browsers remember some of the cache resources of your websites and increase newspaper theme speed. Under, expire headers, you must add the resources which are not changed frequently like logo, CSS, font, etc.

To set up, expires headers, you have to edit .htaccess under cPanel Admin Panel. Head toward .htaccess and add the following code.

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
ExpiresByType font/truetype "access plus 604800 seconds"
ExpiresByType font/opentype "access plus 604800 seconds"
ExpiresByType application/x-font-woff "access plus 604800 seconds"
ExpiresByType application/x-font-svg "access plus 604800 seconds"
ExpiresByType application/vnd.ms-fontobject "access plus 604800 seconds"
ExpiresByType image/svg+xml "access plus 604800 seconds"
ExpiresByType application/xhtml+xml "access plus 604800 seconds"
ExpiresByType text/html "access plus 604800 seconds"
</ifModule>
# END Expire headers

Note: If you are using WP Rocket, it will automatically place the code.

4) Optimize Images (Using Lazyload)

Images play a vital role in the webpage’s performance. So optimization of images is mandatory. There is plenty of software to optimize images like photoshop.

You can also use plugins to optimize images but using a lot of plugins is not good for WordPress site. You can use plugins like ………………………..

If you don’t want to have plugins installed or software, you can use the following code as it automatically compresses images to 50%. This is the code provided by the official tagDiv Teams. Add this code under function.php of newspaper theme.

 

add_filter( 'jpeg_quality', create_function('', 'return 50;' ) );

Also, don’t forget to enable lazyload in the theme panel of the newspaper theme. Goto Theme Panel, click on template settings, and select lazyload features.

Lazyload Newspaper Theme

5) Enable Gzip compression

To enable Gzip compression,  you have to edit .htaccess file under the cPanel Admin Panel. Head toward .htaccess and add the following code.

<IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
<IfModule>

6) Removing Unused Script to Load

There are many unused scripts available in the newspaper theme. So, unloading the unused scripts is the best idea to increase newspaper theme speed. Some of the unused scripts are given below.

Font awsome

Font awsome is used to show icon in the webpages. If you are not using font awsome, then loading them is not the best idea. Since the newspaper theme used various icons, so adding a few filters is good so it loads essential icons only when needed. To add a filter to those icons which are not used to increase newspaper theme speed.

//Load Essiential Icon When Needed
add_filter( 'fontawesome_essentials' , 'fontawesome_essentials' )
function fontawesome_essentials()
{
   return true;
}

Add the above code in functions.php of the theme. To access functions.php of the main theme, goto /wp-content/themes/Newspaper/functions.php.

Or, go to Appearance and click on a theme editor. There you will get functions.php of the main theme.

Emojis

If you don’t use emoji on your webpages, then unloading emojis are the best options. It is not necessary to load unnecessary scripts when we are not using them. So remove them to increase newspaper theme speed.

Add the above code in functions.php of the theme.

// Removing Unused Emojis

add_action( 'init', 'disable_wp_emojicons' );
function disable_wp_emojicons()
{
      remove_action( 'admin_print_styles', 'print_emoji_styles' );
      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_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
      remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
      remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
}

Note: If you are using WP Rocket, enable disable emoji under Media Options.

Jetpack Scripts

Add the following code in functions.php of the newspaper theme to remove jetpack script

// Remove Jetpack css
add_filter( 'jetpack_implode_frontend_css', '__return_false', 99 );

// Remove Devicepx script
function jeherve_dequeue_devicepx()
{
   wp_dequeue_script( 'devicepx' );
}
add_action( 'wp_enqueue_scripts', 'jeherve_dequeue_devicepx' );

Other Scripts

According to tagDiv, the newspaper theme comes with inbuilt embed scripts. Since it is not necessary for WordPress, so removing them is the best option.

// Remove WP embed script

function stop_loading_wp_embed()
{
    if (!is_admin())
          {
               wp_deregister_script('wp-embed');
          }
}
add_action('init', 'stop_loading_wp_embed');

7) Mobile Theme Optimization

Using tagDiv Mobile Plugin

tagDiv has its own mobile theme available for the newspaper theme. So to increase newspaper theme speed in mobile, enable a mobile theme. It will help you a lot for mobile visitors. The current mobile theme does not support both newsletters and multipurpose so removing them is the best idea.

You can add the following code in functions.php of the mobile theme of the newspaper theme. (Path: /wp-content/plugins/td-composer/mobile/)

Use the following code only if the tagDiv mobile theme is enabled.

// Remove Multi Purpose Style
add_action( 'wp_enqueue_scripts', 'remove_multi_purpose', 20 );
function remove_multi_purpose()
{
   wp_dequeue_style( 'td-plugin-multi-purpose' );
}

// Remove Newsletter Style 
add_action( 'wp_enqueue_scripts', 'remove_newsletter', 20 );
function remove_newsletter()
{
    wp_dequeue_style( 'td-plugin-newsletter' );
 }

Using Amp plugins

The newspaper theme has its integrations with Offical Amp so using the amp might be a great option for you. It helps to increase the performance of the website.

Just enable the AMP plugins with its default settings. You can alter the settings as you need.

8) Preload Newspaper Font

Preloading fonts is very essential as it hampers the speed of the newspaper theme. Add the following code in functions.php of newspaper theme.

Don’t forget to replace www.domain.com with your domain name.

// Preload Newspaper fonts for a responsive theme
function dns_prefetch_responsive() 
{
	echo "https://www.domain.com/wp-content/themes/Newspaper/images/icons/newspaper.woff?17' rel='preload' as='font' type='font/woff' crossorigin>";
}
add_action( 'wp_head', 'dns_prefetch_responsive', 0 );

Add the following code in functions.php of the mobile version.

Path(/wp-content/plugins/td-composer/mobile/)

// Preload Newspaper fonts for mobile theme
function dns_prefetch_mobile() 
{
	echo "<link href='https://www.domain.com/wp-content/plugins/td-composer/mobile/images/icons/mobile-theme.woff?9' rel='preload' as='font' type='font/woff' crossorigin>";
}
add_action( 'wp_head', 'dns_prefetch_mobile', 0 );

For WP Rocket, they have a feature called Preload Font Under Preload Options. So WP Rocket users have high features. All the fonts available in the server can be preloaded by these features.

Conclusion

I hope you have followed all the methods mentioned above. I will update the post if I get any new ideas. Now, check your page speed in insights. I hope it helps you to increase newspaper theme speed.

Must Read: Test Website Speed

Don’t forget to share these articles, if it helps you a lot. If you have any issues or questions, comment in the below comment sections.

LEAVE A REPLY

Please enter your comment!
Please enter your name here