3 chestiuni utile pentru optimizarea WordPress

Pe langa scris, un blogger trebuie sa fie si un pic tehnic, sa aiba niste cunostinte minime, sa stie ca are nevoie de backup, de hosting de calitate, de un software de micsorat imagini, etc.

Iata mai jos 3 chestiuni utile, dar prea putin folosite in prezent:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^itpress.ro[nc]
RewriteRule ^(.*)$ http://itpress.ro/$1 [r=301,nc]

Face ca atunci cand tastati “itpress.ro” sa fiti redirectati automat catre “http://itpress.ro/” si, de asemenea, ajuta si la SEO, sa nu creada motoarele de cautare ca sunt 2 siteuri diferite.

# 480 WEEKS
<FilesMatch “.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$”>
Header set Cache-Control “max-age=290304000, public”
</FilesMatch>

# 2 WEEKS
<FilesMatch “.(css|js)$”>
Header set Cache-Control “max-age=1209600, must-revalidate”
</FilesMatch>

# 2 HOURS
<FilesMatch “.(html|htm)$”>
Header set Cache-Control “max-age=7200, must-revalidate”
</FilesMatch>

Cache simplu, pentru HTML si alte fisiere. Cele 2 se pun in .htaccess.

add_theme_support( ‘post-thumbnails’ );
remove_action(‘wp_head’, ‘rsd_link’);
remove_action(‘wp_head’, ‘wp_generator’);
remove_action(‘wp_head’, ‘index_rel_link’);
remove_action(‘wp_head’, ‘wlwmanifest_link’);
remove_action(‘wp_head’, ‘start_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘parent_post_rel_link’, 10, 0);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0);
automatic_feed_links(false);

Aceasta comanda se pune in functions.php din tema si face o multime de lucruri utile, cum ar fi sa curete chestiile inutile din header.

 


Posted

in

by