How to add Expires Headers in WordPress using htaccess?

To add Expires Headers in WordPress using htaccess. Add the following code in your htaccess file located in WordPress root folder.

#BEGIN EXPIRES CACHING 
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType text/css "access 1 month"
	ExpiresByType text/html "access 1 month"
	ExpiresByType image/gif "access 1 year"
	ExpiresByType image/png "access 1 year"
	ExpiresByType image/jpg "access 1 year"
	ExpiresByType image/jpeg "access 1 year"
	ExpiresByType image/jp2 "access 1 year"
	ExpiresByType image/x-icon "access 1 year"
	ExpiresByType image/svg+xml "access plus 1 month"
	ExpiresByType audio/ogg "access plus 1 year"
	ExpiresByType video/mp4 "access plus 1 year"
	ExpiresByType video/ogg "access plus 1 year"
	ExpiresByType video/webm "access plus 1 year"
	ExpiresByType application/atom+xml "access plus 1 hour"
	ExpiresByType application/rss+xml "access plus 1 hour"
	ExpiresByType application/pdf "access 1 month"
	ExpiresByType application/javascript "access 1 month"
	ExpiresByType text/x-javascript "access 1 month"
	ExpiresByType text/x-component "access plus 1 month"
	ExpiresByType application/x-shockwave-flash "access 1 month"
	ExpiresByType font/opentype "access plus 1 year"	
	ExpiresByType font/truetype "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresByType application/x-font-ttf "access plus 1 year"
	ExpiresByType application/x-font-opentype "access plus 1 year"
	ExpiresByType application/font-woff "access plus 1 year"
	ExpiresByType application/font-woff2 "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresDefault "access plus 1 year"
</IfModule>
#END EXPIRES CACHING

Have any doubt, then comment here!

How to enable ENABLE MOD_PAGESPEED in WordPress using htaccess?

To enable ENABLE MOD_PAGESPEED in WordPress using htaccess. Add the following code in your htaccess file located in WordPress root folder.

# ENABLE MOD_PAGESPEED START
# COMBINE CSS, COMPRESS IMAGES, REMOVE HTML WHITE SPACE AND COMMENTS
<IfModule pagespeed_module>
	ModPagespeed on
	ModPagespeedEnableFilters rewrite_css,combine_css
	ModPagespeedEnableFilters recompress_images
	ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp
	ModPagespeedEnableFilters collapse_whitespace,remove_comments
</IfModule>
# ENABLE MOD_PAGESPEED END

Have any doubt, then comment here!

How to Enable/Disable Automatic Update for All WordPress Plugins

By default, WordPress background updates only happen for plugins in special cases, as determined by the WordPress.org. Because the special cases will be controlled by the WordPress security team for patching critical vulnerabilities. To enable or disable updates for plugins, you can use the auto_update_plugin filter.

You can enable WordPress to automatically install all plugin updates by simply adding this code to your theme’s functions.php file.

add_filter( 'auto_update_plugin', '__return_true' );

You can disable WordPress to automatically install all plugin updates by simply adding this code to your theme’s functions.php file.

add_filter( 'auto_update_plugin', '__return_false' );

Have any doubt? Comment here!

How can I make sure my website is secure?

The best way to ensure your website remains safe is to follow a few simple steps:

  • Use strong passwords for all user accounts.
  • Take backups of your WordPress website.
  • Update your WordPress installation, themes and plugins (though we do recommend testing updates on a localhost installation or on a staging site first). And if theme or plugin you’re currently using hasn’t been updated in the last couple years you might want to consider switching to a new one.
  • Don’t install illegal downloads of premium themes and plugins, which almost always include malicious code (virus, spam, hacker backdoor, etc).
  • Only use plugins and themes from trustworthy websites. We don’t recommend downloading from forums or third party sharing sites (torrents). If you aren’t sure of a website’s trustworthiness check customer reviews, item ratings and social accounts.

What are the main error types in PHP and how do they differ?

In PHP there are three main type of errors:

  • Notices – Simple, non-critical errors that are occurred during the script execution. An example of a Notice would be accessing an undefined variable.
  • Warnings – more important errors than Notices, however the scripts continue the execution. An example would be include() a file that does not exist.
  • Fatal – this type of error causes a termination of the script execution when it occurs. An example of a Fatal error would be accessing a property of a non-existent object or require() a non-existent file.

Understanding the error types is very important as they help developers understand what is going on during the development, and what to look out for during debugging.

Is wordpress.com more secure than wordpress.org?

Yes, wordPress.com is considered to be more secure than WordPress.org because it limits the themes and does not allow the installation of plugins. But, the security is, however, more dependable on how your website is hosted by the hosting company and also the steps they take to prevent the security problems.

What is a WordPress taxonomy?

In WordPress, a “taxonomy” is a grouping mechanism for some posts (or links or custom post types). There are four default taxonomies in WordPress they are

  • Category
  • Tag
  • Link Category
  • Post Formats

You are also free to create your custom taxonomies too.