Static WordPress Community

Create files from plugin interface

Static Output/WP2Static can create _redirects file from its settings.
Would it be possible to create other files, i.e., robots.txt, sitemap.xml, ads.txt, etc., straight from the plugin settings?
This is to reduce workflow, as I usually have to deploy the site, download it again just to add those files, and then re-upload the site.


Hi @mulyadi,

Good question. To clarify, you’d like free-entry text fields to input the content of these files?

Sitemaps should be properly rewritten in WP2Static, using a sitemap parsing library (now incorporated into the plugin itself), but this hasn’t made it’s way into Static HTML Output yet.

That should save you from having to manually do anything for the sitemaps, at least.

robots.txt is a good candidate for manual entry, as a dev server’s one can look very different (or not need to exist) vs a production site’s.

For ads.txt, this should be copied across as expected, with URL rewriting to match the deployment site’s domain. If this isn’t occuring, please create an issue to report the bug

How are you deploying at the moment? We can probably add a little function to your theme’s functions.php to insert the right files at the point in the process between Static HTML Output generating the site, before it deploys.

Yeah, that’s what I mean, i.e., free-entry text field.
Sitemap isn’t copied properly on SHO.

I tried newest version of WP2Static, and it doesn’t work.
@leonstafford can you answer it in the thread?

I’m currently using SHO for deployment.
It doesn’t copy background image.
So I have to upload the image manually, hence the back and forth of upload, download, and re-upload.

1 Like

Thanks for your patience while these things are improved. Did you get that background image issue into GitHub Issues? Once I get to sorting out missing assets, I’ll be fixing any listed there, usually a big batch at a time, so I can devote my brain space to that kind of work :slight_smile: