Documentation / Administrator Guide / Configuration / Build Settings

Build Settings

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.

Destination URL

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://wordpress.mydomain.com/ to 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.

Additional URLs

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:

  • /wp-sitemap.xml
  • /robots.txt
  • /favicon.ico

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

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.

Excluded URLs

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 /some-.

  • 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.

Additional Redirects

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 HTTP version Type Cachable Request Method Subsequent Request
301 HTTP/1.0 Permanent Yes GET / POST may change
302 HTTP/1.0 Temporary Not by default GET / POST may change
307 HTTP/1.1 Temporary Not by default may not change
308 HTTP/1.1 Permanent By default 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: