The Build Settings play a crucial role in defining the scope and structure of your WordPress site’s static version. They allow you to specify which content is included or excluded, and how content links are handled.
The Destination URL is where your static site will be hosted, such as
https://www.mydomain.com/. For instance, if your dynamic WordPress installation is located at
https://wordpress.mydomain.com/, Staatic will transform all references from
https://www.mydomain.com/ to match the destination URL.
You have the flexibility to use either an absolute URL or a relative URL for the destination. Relative URLs, like
//mydomain.com/ or simply
/, enable your site to be served across different schemes (http or https) or domains. If you specify a path other than
/, Staatic will prepend this path to all URLs, facilitating the deployment of your site within a subdirectory structure.
For cases where you need to access your site offline, such as local browsing without a web server, or for specific configuration needs, you can opt for the Offline URL setting. Choosing this option adjusts all site URLs to be path relative, ensuring they can properly resolve without requiring an active server environment. This feature is particularly useful for testing, development, or presentations where direct internet access to the hosted site is not available.
To create a static version of your website, Staatic initiates the process by accessing your WordPress site’s front page. It systematically follows the links found on this initial page, crawling through your site to process every accessible page and asset. However, pages or assets not linked from anywhere within your site will be omitted from the final static version unless they are explicitly added to the list.
By default, Staatic is designed to follow any link that belongs to your site, discovered during the crawl, incorporating each page it navigates into the static site it generates. For finer control over this process, you can utilize the Advanced options. Here, you have the flexibility to prevent Staatic from following links from certain pages or exclude specific pages from being included in the static output. This is achieved by enabling Advanced options and toggling the Follow or Save options for individual links as needed.
Here are some examples of common additional URLs:
Note: In cases where an XML sitemap is present, it is recommended to include it in this list. Not only does it make sure all content is included in the static version of your site, it also provides a better indication of the progress while the publication process is running.
Additional paths function similarly to Additional URLs, with the key difference being that these refer to paths on the filesystem, which are converted into URLs for inclusion in the static site.
Note: directories specified as paths are scanned recursively by default. This behavior can be customized via Advanced options.
It’s advisable to include your WordPress uploads directory (e.g.,
/wp-content/uploads) to ensure all static assets are included in your static site.
Staatic automatically incorporates any site-linked page it discovers during crawling into the static site. The Advanced options allow for detailed control over this process for URLs derived from additional paths. Here, you can decide whether Staatic should follow links, save pages, or perform recursive scans on directories identified through these paths. Adjust these settings to customize your site’s static version, ensuring inclusion of only essential content.
Similar to how Additional URLs are included in your static site, Excluded URLs specify which pages or assets Staatic should ignore during the crawling process. This ensures that specified content is not included in the final static version of your site.
Staatic supports the exclusion of URLs through three types of rules, allowing for precise control over what gets excluded:
Simple rules: target a specific URL for exclusion with an exact match. For instance, specifying
/some-page/will exclude this specific page from being included.
Wildcard rules: utilize wildcards to exclude a range of URLs that match a pattern. For example,
/some-*can be used to exclude any URLs that start with
Regular expression rules: utilize regular expressions for more complex matching criteria, such as
~^/excluded-page-[1-3]/?$~, to exclude URLs that match the specified regex pattern.
All rules are applied in a case-insensitive manner and match against normalized URL segments, including the path, query, and fragment, ensuring comprehensive coverage across your site’s structure.
Note: When using regular expression rules, ensure
~is used as the delimiter. Please be aware that modifiers are not supported at this time.
Staatic effectively handles HTTP redirects encountered during its crawling phase, incorporating them into the static version of your site. For redirects that do not exist within the dynamic WordPress environment but are still needed, you have the option to specify them manually in this section.
Supported HTTP status codes for redirects are as follows:
|HTTP Status Code
|Request Method Subsequent Request
|GET / POST may change
|Not by default
|GET / POST may change
|Not by default
|may not change
|may not change
Configuring additional redirects can be crucial in several scenarios. A common example is when you’ve changed the slug of a post, rendering the original URL obsolete. In such cases, it’s important to ensure that the old URL redirects to the new one, preventing any 404 errors and preserving the user experience as well as SEO rankings.
Staatic supports integration with several widely-used WordPress redirection plugins, enabling the automatic import of basic redirects configured within these tools.
Compatible plugins include: