Making the most of WordPress

The Verdict on Gutenberg

For the most part, I like Gutenberg. Seriously. Still, I see a couple of issues in the underlying philosophy behind anything like Gutenberg that may create future problems. Gutenberg's official mission statement is to "go beyond the post into page templates and ultimately, full-site customization." In practice, Gutenberg was developed to prevent WordPress from losing users to services like Medium and Squarespace or page builders like Elementor. This is a noble and necessary goal, but one that can potentially backfire.

My issues with Gutenberg are the same ones I have with desktop office suites, "user-styled content" in GeoCities, and the <blink> HTML tags. First, mixing content and styling in one interface can make content (especially web content) much less portable to other publishing systems in the long run. Themes should be compatible with open, platform-independent standards, not with any one editor. Second, Gutenberg's "block-based editing" is as easy to use as it is to misuse (the Internet contains tens of millions of really embarrassing PowerPoint slideshows and MySpace pages).

However, if this frees users from Facebook, Medium, and the like, more power to Gutenberg. Just be very, very careful with it and avoid bloated themes!

Advanced Topics

WordPress 5 includes three often ignored tools that make it even more powerful and flexible. First, Tools | Import (Figure 8) lists all the plugins available to semi-automatically import content from other WordPress blogs or other sources. While I haven't tested all of these options, some of these plugins have saved me a lot of time.

Figure 8: WordPress 5 can import your existing posts from many sources, though some may require extra manual work.

An even more powerful WordPress tool is WP-CLI [7], the command-line interface for WordPress, which I have been using since 2011 [8]. Technically speaking, WP-CLI is a PHP command-line utility that works with any version of WordPress 4 and 5. Installing it only takes a couple of minutes at a Linux prompt, and it can be a timesaver. The WP-CLI commands are simple, well-documented, and can do anything from installing WordPress and WordPress plugins to publishing posts, moderating comments, cleaning the WordPress cache, and managing menus. Inside a shell script, WP-CLI can clone a fully customized WordPress site or import thousands of posts from any database or set of text files while you take a nap. Try it!

The final ignored WordPress tool is a plugin that does something that might seem like pure idiocy: Using WordPress to generate a completely static website!

The first websites were nothing but collections of static images and text files in HTML format. Consequently, every visitor saw exactly the same pages as everybody else and could not interact with the website with the exception of basic forms or JavaScript-based menus.

Dynamic websites like WordPress changed all that, because they are written in PHP or similar languages, which are executed by the web server every time a user requests a page. This architecture is what lets us post comments, fill forms, make purchases, browse images, complete surveys, and so on.

However, a drawback to dynamic websites is speed: Fast themes and plugins cannot do miracles. Unless you spend a lot of money on hosting, dynamic websites can be much slower than static ones, even if the latter are on free hosting accounts. Even more important is maintenance: It may take just a few minutes per week, on average, but if you don't always keep your WordPress installation as clean and up-to-date as possible, sooner or later it will stop working or be hacked.

While the money and/or time is justified in most scenarios, there are a couple of surprisingly common ones where a static site is preferable.

The first one is when your WordPress website reaches its end of life (usually because a project finishes). At that point, you may want the website to remain online, even if you are sure that nothing will be added or modified. In this case, continuing to run WordPress is both a waste of resources and a guarantee that sooner or later it will be hacked.

The other reason to make static versions of your WordPress website is if you want WordPress for yourself and not your users. When you want WordPress's themes, plugins, dashboard, and editor, but do not need user comments or any other interaction (search fields, dynamic calendars). In this case, you can:

  1. Install and run WordPress on your laptop with the WP2Static [9] plugin, which works better for this kind of job than web mirroring tools like wget.
  2. Disable anything that may not work as a static copy (sliders, search fields, etc.).
  3. Run the plugin every time you add or modify your content or theme.
  4. Automatically copy the static version to your static hosting account, with rsync or similar tools.
  5. Enjoy your website made with all the power of WordPress, but much faster and more resistant to attacks.

Keep It Simple

Less is more and lasts longer, so use as few plugins as possible and the cleanest (but mobile-friendly) theme you can tolerate. Follow that rule, and WordPress 5 will give you, and all your website visitors, plenty of satisfaction.

Infos

  1. WordPress: https://wordpress.org
  2. 25 Astonishing WordPress Facts: https://www.whoishostingthis.com/compare/wordpress/stats/
  3. The WordPress blog used in this tutorial belongs to my son.
  4. Let's Encrypt: https://letsencrypt.org
  5. Using permalinks: https://wordpress.org/support/article/using-permalinks/
  6. WordPress 5 Ultimate Cheat Sheet: https://www.codeinwp.com/blog/wordpress-5-0-cheat-sheet/
  7. WP-CLI: https://wp-cli.org/
  8. How to post content to a WordPress blog from the command line: http://freesoftware.zona-m.net/how-to-post-content-to-a-wordpress-blog-from-the-command-line/
  9. WP2Static: https://wordpress.org/plugins/static-html-output-plugin/

The Author

Marco Fioretti (http://mfioretti.com) is a freelance author, trainer, and researcher based in Rome, Italy, who has been working with free and open source software since 1995, and on open digital standards since 2005. Marco also is a board member of the Free Knowledge Institute (http://freeknowledge.eu).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News