Add missing pages/files to your static website
Simply Static offers some ways to add missing files to your static website.
Why pages/files are missing?
Several ways can prevent files from being exported to your static website. Let's cover the most common ones:
The file/page isn't linked somewhere
Simply Static works like a real user (or a Google Bot). It starts exploring your website from your homepage and follows each link it can find to create a static copy. If a page/file isn't linked somewhere, Simply Static will not have a chance to pick it up and make a static copy of the content.
How to fix:
The easiest way is to link your content. This can be a regular link within your content or by using an HTML Sitemap linked in the footer of your website. You can also manually include items to export using the options under the Include section.
Manually adding items to include with your export
Simply Static allows you to manually include additional URLs, files, and folders that are not automatically discovered during export. This is useful for:
- Hidden or unlinked pages
- Marketing landing pages
- Custom script files
- Asset folders not referenced by WordPress
- Documentation pages
- Files inside uploads, themes, or plugins directories
With starting with Simply Static 3.5.6+, these fields now support regex patterns in addition to standard literal (eg. normal/plain text) entries, giving you much more flexibility and control.
Version note: Regex support for excludes is available starting with Simply Static version 3.5.6+. If you don’t see the behavior described below, update to the latest plugin versions.
Where to Find These Settings
In your WordPress dashboard:
Simply Static → Settings → General → Include
You’ll see two fields:
- Additional URLs
- Additional Files and Directories
Both fields support either:
- Literal URL / file path (one per line)
- Regex pattern (
/pattern/flagsadvanced users)
How Each Line Is Interpreted
Each line in either box is interpreted in one of three ways:
- Literal entry - The line is treated as an explicit URL or a real filesystem path.
- Regex pattern - A line wrapped in
/delimiters (example:/\/docs\/.*$/i) is treated as a regular expression. - Invalid regex - If Simply Static cannot validate your regex, it automatically falls back to treating it as a literal.
Using Additional URLs
Use this to add pages that:
- aren’t linked in your menus
- are intentionally hidden
- are dynamically generated by a plugin
- don’t appear in your sitemap
- aren’t part of WordPress’ discovered URLs
Literal URLs (most common)
Just add one URL per line:
https://example.com/landing/ https://example.com/hidden-page/
Note: The links must be URLs using the domain of your WordPress site.
Regex URLs
Regex adds powerful pattern-matching to automatically include URLs based on their structure.
How regex URL matching works
Regex does not generate new URLs. Instead, Simply Static matches your regex against a prebuilt candidate list of known URL paths:
- Posts
- Pages
- Custom post types
- Categories & taxonomies
- Author archives
- Pagination URLs
- Other detected URLs in WordPress
Any URL in that list that matches your regex will be added to the export.
Examples
Include all pages under /docs/ :
/\/docs\//
Include only “install” or “getting-started”:
/\/docs\/(install|get-started|getting-started)\/?$/i
Match all product pages:
/\/product\/.+/
Important limitations
- Regex only works on URLs that already exist in WordPress.
- If the URL does not exist in the candidate list, it cannot be added by regex.
Using Additional Files & Directories
Use this when you need to include real files or folders from the server’s filesystem—for example:
- PDFs not linked anywhere
- Theme or plugin asset folders
- JSON data files
- Downloadable files inside custom folders
Literal Paths To Files & Directories
Enter absolute paths (Simply Static will normalize slashes automatically):
/var/www/example.com/wp-content/uploads/my.pdf /var/www/example.com/wp-content/uploads/brochures/ /var/www/example.com/wp-content/themes/my-theme/assets/
Note: Directories are scanned recursively.
Regex for Files & Directories
Regex for filesystem inclusion works on actual normalized full paths.
How it works
- Simply Static scans a set of root directories (default:
ABSPATH,WP_CONTENT_DIR). - Every normalized file path is matched against your regex.
- Matching files are added to the export.
Examples
Include all PDFs under uploads:
/wp-content\/uploads\/.*\.pdf$/i
Include JSON or TXT files in theme assets:
/wp-content\/themes\/my-theme\/assets\/.*\.(json|txt)$/i
Include all SVGs anywhere:
/\.svg$/i
Notes:
- Regex matching is path-based, not URL-based.
- Files outside the scanning roots won’t be found unless roots are customized using filters.
- Excluding large patterns (e.g.,
.*) may slow down file scanning.
Advanced Controls (Developers)
Developers can configure candidate lists, scan roots, and performance limits via filters:
ss_regex_candidate_urls– modify URL list for regex matchingss_additional_url_regex_max_matches– cap URL regex resultsss_additional_file_regex_roots– extend filesystem search rootsss_additional_file_regex_skip_dirs– ignore certain directoriesss_additional_file_regex_max_matches– cap file regex results
Troubleshooting
Nothing is added from my regex
- Ensure the line starts and ends with
/. - Check for proper escaping (e.g.,
\/). - For URL regex: make sure the target URL exists in WordPress.
- For file regex: ensure the file exists within allowed search roots.
My regex is ignored
- Invalid regex → treated as literal (normal/plain text). Use a validator or test with PHP’s
preg_match.
File regex seems slow
- Your pattern might be too broad.
- Try anchoring it:
/^\/var\/www\/example.com\/wp-content\/uploads\/.*\.pdf$/
Missing Images
You may notice that images are missing on your static website, even if they are part of your actual website content. This most likely happens when using Page Builders like Elementor or Divi Builder. It's because your images are added as background images via CSS and not directly added to the DOM of your website.
Simply Static tries to extract as much information from your HTML as possible. Still, the extractor does not convert many different markup styles and combinations by default.
How to fix
Thankfully, there is an easy way to add additional rules to the extractor of Simply Static by using the following code snippet:
add_filter('ss_match_tags', function( $tags ) {
$tags['div'] = [ 'href', 'src', 'style' ];
$tags['li'] = [ 'style' ];
$tags['span'] = [ 'style' ];
return $tags;
} );
In the following example, we add the style attribute for all <div>, <li>, and <span> tags of your website. Simply Static will now search within the attribute and extract all images added as a background image.
You can add this to the functions.php of your child theme or by using the Code Snippets plugin.