How do I add static pages to WordPress? How do I add static pages to WordPress? wordpress wordpress

How do I add static pages to WordPress?


If you (as the OP asked) want it to appear without having to add .html, simply create a folder at the same location where your WP site's index.php appears, and then name the file that you put inside that folder index.html.

Example, if you have a WordPress installation at doesnotexist.com and you want to add a static page, separate from your WP installation, that people can get to at doesnotexist.com/wedding - create the folder named wedding, and put the HTML in an index.html file inside the wedding folder. You also can then of course put other files in that folder or in folders within it so that the static page can reference images, styles, code, etc.

As someone said above, if the file for the URL exists, then WP won't get invoked to route the request. If you later remove the "wedding" folder or the "index.html" file from within it, anyone who tries to get to doesnotexist.com/wedding then would be routed to WP and, if no matching permalink was found, they'd see the 404 page not found error or whatever your theme or a plug-in is set up to show for broken links.


The static page functionality of WordPress is called, cleverly, "Pages." You can read all about them here: https://wordpress.org/support/article/pages/ .


You do not need to install any additional plug-in. Just follow the following procedure and you are good to go.

  1. Create a page under Administration>Pages>Add new.
  2. Enter the name you want for your page, the custom URL and press publish.
  3. This would generate a record in your database under the wp_posts table. (wp_ is the default prefix for your wordpress tables. If you changed it during the installation procedure, replace it with your custom prefix). Find the ID that has the name of your page in the table.
  4. Go to wp-content\themes\YOUR_ACTIVE_THEME in your wordpress installation directory or in the sub-folders(it depends how the theme has been structured). There would be page.php file. Create a page-{ID}.php file in the same directory.
  5. It's ready. Add any static html file to page-{ID}.php file.

Now, if you go the custom URL, you can find the static content you put in page-{ID}.php file.