WordPress: Difference between revisions
imported>Onny mNo edit summary |
imported>Onny Add notes on SEO |
||
Line 143: | Line 143: | ||
define('FORCE_SSL_ADMIN', true); | define('FORCE_SSL_ADMIN', true); | ||
$_SERVER['HTTPS']='on'; | $_SERVER['HTTPS']='on'; | ||
''; | |||
</syntaxHighlight> | |||
=== Search engine optimization (SEO) === | |||
'''Meta information''' | |||
To be done | |||
<syntaxHighlight lang="nix"> | |||
services.wordpress.sites."example.org" = { | |||
plugins = [ pkgs.wordpressPackages.plugins.wordpress-seo ]; | |||
}; | |||
</syntaxHighlight> | |||
'''Picture compression''' | |||
To be done | |||
<syntaxHighlight lang="nix"> | |||
services.wordpress.sites."example.org" = { | |||
plugins = [ pkgs.wordpressPackages.plugins.webp-express ]; | |||
}; | |||
</syntaxHighlight> | |||
'''Lazy load images''' | |||
Using the Wordpress plugin [https://wordpress.org/plugins/jetpack Jetpack], it is possible to enable lazy loading of images. That means, images only visible in the current view of the web browser are loaded. This will speed up initial page load. | |||
<syntaxHighlight lang="nix"> | |||
services.wordpress.sites."example.org" = { | |||
plugins = [ pkgs.wordpressPackages.plugins.jetpack ]; | |||
}; | |||
</syntaxHighlight> | |||
After enabling the plugin, in the Wordpress admin interface go to ''Jetpack -> Settings -> Performance'' and ensure that lazy loading of Images is enabled. Note that Jetpack comes with a lot of optional modules which should be disabled if not used. On the same page go to ''Debug'' in the bottom menu and click on the last link offering the list of all modules. Disable all modules you don't need instead of ''Lazy Images''. | |||
'''Webserver compression''' | |||
<syntaxHighlight lang="nix"> | |||
services.nginx.extraConfig = '' | |||
gzip on; | |||
gzip_vary on; | |||
gzip_comp_level 4; | |||
gzip_min_length 256; | |||
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; | |||
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; | |||
''; | ''; | ||
</syntaxHighlight> | </syntaxHighlight> |