0

I wonder how to display a static page in order to increase the page load a little bit: The first option is to put the content in the database (via the Admin GUI), the second option is to create a page-slug.php without calling the loop within page-slug.php. The latter option would be useless if the database is still queried, which leads to my questions

  • Is it better in terms of page load to use page-slug.php for static pages instead of putting the content into the database?
  • Will wordpress query the database if I use page-slug.php (with the loop) in order to check if there's any content for this page?
1

Yes. It will. WordPress will query the database for that page regardless of whether or not you use the loop.

If you're only talking about adding a chunk of content into the editor, then you're way overestimating the impact of querying the database for a single page.

There are plenty of plugins available that will render your pages to static files that won't query the database (or run PHP at all), if that's the direction you want to go in. WP Super Cache and WP Rocket are two that come to mind.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.