Wordpress Hosting Experts
Total Page:16
File Type:pdf, Size:1020Kb
BROUGHT TO YOU BY The Static WordPress Hosting Experts STATIC-FIRST WORDPRESS AN APPROACH TO BUILDING STATIC READY WEBSITES WITH WORDPRESS Static WordPress WHY GO STATIC-FIRST WITH WORDPRESS? In this guide we’ll go over a “static-first” approach to building websites with WordPress. This approach allows any WordPress site to be easily converted to and launched as a static site. Static websites do not require database connections or server side programming and therefore have three major benefits: speed, scalability and security. FASTER SITES SCALABILITY Static sites don’t need to waste time Static sites also do not suffer from grabbing content from a database, scalability issues. Traditional since the content is already pre- WordPress sites choke with too rendered as static files and is many visits at the same time. Static therefore faster than sites relying on a sites do not have the same database (ie traditional WordPress bottleneck of an underlying sites). Faster sites provide a more processing server ,and therefore far enjoyable experience for visitors and outperform traditional WordPress have proven to increase revenues, sites when it comes to lots of traffic. conversion rates, and lowering bounce rates. SECURITY Possibly the best feature of a static Aldo shoe brand noticed a 327% site is that there is no database to increase in revenue between a slow hack. A static site is completely running site and faster (source). isolated from the content The outdoor brand Rossignol saw a management system that powers it. 94% increase in conversion when WordPress is infamous for security improving their site speed (source). risks due to being outdated or The coupon site Radins.com running insecure plugins. More than reduced bounce rate 25% with an 70% of WordPress sites are improvement in their page load vulnerable to attack (source). A time (source). static site does not have any of these issues or concerns. 1 STATIC SITES ARE FAST, SCALABLE AND MORE SECURE THAN TRADITIONAL WORDPRESS Static WordPress 2 IMPORTANT TERMS A Static Website is one that is 1 composed entirely of HTML, CSS and JavaScript. It does not require a database or server side programming to function. The benefits of static websites are speed, scalability and security. A Traditional WordPress Website is one 2 where visitors access the WordPress site directly. Server side PHP and the WordPress database are required for the functionality of the site. The benefits of a WordPress site are ease of use and a vast ecosystem of themes and plugins. A Static WordPress Site is one that uses 3 WordPress to build the website and manage the content. Then a “static site generator” converts the traditional WordPress site into a static website. This offers the combined benefits of a static site and a WordPress site. A Static Site Generator is software that 4 builds a static website. A variety of static site generators exist, but only a few are designed to convert traditional WordPress sites into static sites. Static WordPress 3 M A K IN G T H E L EA P F R O M T R A D I T I O N A L W O R D P R ES S TO STATIC WORDPRESS When building a website with WordPress there are certain considerations that need to be taken for the site to work as a static site. Not all traditional WordPress sites can be passed through a static site generator and continue to work properly as static sites. In this guide we show how to build WordPress sites with a “static-first” approach so they work as traditional WordPress sites and as static WordPress sites. This will give you a consistent toolset and workflow for all of your WordPress projects, regardless of whether they launch as static sites or traditional WordPress sites. Static WordPress 4 MAKING & CHOOSING STATIC-COMPATIBLE WORDPRESS THEMES In general, most WordPress themes handle the conversion process to a static site with no problems. So, you can choose from any of the free themes in THEME FUNCTIONALITY WordPress.org repository or premium themes in from theme THAT MAY NOT WORK marketplaces or from individual ON A STATIC SITE theme creators. Some themes do include features Infinite Scroll that uses AJAX that may not work after being Like or Up Vote buttons converted to a static site. This Relative timestamps using does not mean you cannot use PHP (ie Posted 3 days ago) the theme at all, but you may A related posts section that need to replace certain theme require AJAX features with static-compatible Loading content using AJAX plugins or third-party tools. Pagination navigation that doesn’t refresh the page Theme features that do not Search that requires the work after being converted to a database or query parameters static site are usually those that (ie https://site.com/? require live communication q=searchterm) with the WordPress database. This is most commonly done Forms that are not static using a process called AJAX compatible where JavaScript communicates with PHP on the WordPress side and possibly the WordPress database. 5 If you are unsure whether a theme will work as a static site, you can contact the developer with the following message: H i ! W e a r e p l a n n i n g t o l a u n c h t h i s W o r d P r e s s t h e m e a s a s t a t i c s i t e . W e a r e w o n d e r in g if t h i s t h e m e i n c l u d e s a n y A J A X f e a t u r e s t h a t m i g h t r e q u i r e a c c e s s t o t h e W o r d P r e s s d a t a b a s e t o w o r k ? Static WordPress 6 INFINITE SCROLL YITH Infinite Scrolling WP EasyScroll Posts LIKES AND UP VOTES Commento STATIC- Hyvor Talk FRIENDLY ALTERNATIVES RELATED POSTS Toolbelt TO THEME Similar Posts FUNCTIONALITY RELATIVE TIMESTAMPS Besides the types of features mentioned JavaScript solutions like here, most WordPress Moment JS themes work out of the box when converted to static websites. SEARCH Algolia is the search engine we implement on static sites at Strattic FORMS Hubspot is a great out-of-the- box static-friendly solution. W e c o v e r f o r m s i n - d e p t h u n d e r t h e " C h o o s i n g Y o u r P l u g i n s " s e c t i o n . Static WordPress 7 W H IC H S T A T I C S IT E G E N ER A T O R S S U P P O R T W O R D P R ES S T H E M ES ? Not all static site generators are the same. Static site generators that are built for WordPress will support most themes. These include hosted solutions like Strattic that host your WordPress site and static site as well as stand-alone plugins like WP2Static that just convert the WordPress site to HTML files. Static site generators not built for WordPress, like Gatsby and Hugo do not work with any WordPress themes. These static site generators require you to build and design your site using JavaScript, React or a custom templating language. We assume for a static-first approach to WordPress you will use a static site generator designed to support WordPress and WordPress themes. Static site generators are discussed in more depth in the final section. At Strattic, we use the theme's 404 page. For other static site solutions you may need to configure custom 404 pages. Static WordPress 8 MAKING NATIVE WORDPRESS FEATURES STATIC-COMPATIBLE Once you have chosen your theme, you want to look at native WordPress functionality that will not work when converted to a static site. This includes two native WordPress features: 1. Comments 2. Search. By default, WordPress comments require communicating with the WordPress database whenever a comment is submitted. Similarly, WordPress search also requires querying the WordPress database each time a search is submitted. 9 STATIC-FIRST COMMENTS The simplest approach to going static- Disabling comments for all new posts can first with comments is to not include be done in the Settings > Discussion section. them at all. You will find that some Then previous posts must have their WordPress projects can be simplified comments disabled as well. There is a and made static ready by simply helpful plugin called Disable Comments disabling comments when not needed. that makes the entire process simple. For static projects that require comments, third party solutions are best. as they run on client side JavaScript and do not require the WordPress database. They also offer comment moderation, spam filtering and social sign- in options as core features. Disqus has been a long time popular solution in the world of third party comments. However, code bloat and privacy concerns have led to the rise of lightweight and privacy first options like Commento, and FastComment. Other comment options include Hyvor and Muut, which offer additional features like forums, messaging, and react with emojis. Facebook integration also exists with Facebook Comments. 10 STATIC-FIRST SEARCH If your site require search, hosted search services like The native WordPress search feature requires querying the WordPress Algolia and Elasticsearch are database based on the search terms great options.