How to Install WordPress in a Subdirectory (and Serve It from the Root)
Readers often asked why our URLs include /archives/. In 2006 I didn’t want WordPress files cluttering the root folder, in case I later installed forums or a wiki, so I installed WordPress in quickonlinetips.com/archives/. If you want to install WordPress in a subdirectory too, there are two ways to do it. Here’s how each works in 2026.

Quick answer: To run your whole site at a subfolder address (example.com/blog/), simply install WordPress in that folder. To keep WordPress files in a subfolder but show the site at example.com, install it in the subfolder, set Site Address (URL) to the root in Settings > General, then copy index.php (and .htaccess) to the root and change the require line to point to the subfolder.
Table of Contents
Option 1: Site lives at a subfolder URL
Your blog appears at example.com/blog/ and the root can hold something else (a landing page or another app).
- Create the folder (for example /blog/) in your hosting file manager.
- Install WordPress there with your host’s installer or manually.
- Both WordPress Address and Site Address will be https://example.com/blog.
Option 2: Files in a subfolder, site at the root
This is WordPress’s official “giving WordPress its own directory” method.
- Install WordPress in a subfolder, such as /wp/.
- In Settings > General, keep WordPress Address as https://example.com/wp and set Site Address to https://example.com. Save.
- Copy (don’t move) index.php and .htaccess from /wp/ to the root.
- Edit the root index.php: change
require __DIR__ . '/wp-blog-header.php';torequire __DIR__ . '/wp/wp-blog-header.php'; - Go to Settings > Permalinks and click Save to refresh rules.
The login page stays at example.com/wp/wp-admin/. Full details are in the WordPress documentation.
Things to check
- Take a backup before changing site addresses; a typo can lock you out.
- Moving an existing site? Changing URLs needs 301 redirects and a search-replace of old links.
- Caching and security plugins may need their paths updated.
Testing first? You can install WordPress locally and practise the setup safely.
FAQ
Is a subdirectory bad for SEO?
No. Google treats subfolder URLs normally. Pick one structure and keep it.
Can I move WordPress from a subfolder to the root later?
Yes, but URLs change, so set up 301 redirects from old addresses.
What if I get locked out after changing the Site Address?
Define WP_HOME and WP_SITEURL in wp-config.php to restore the correct addresses.
Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →Get our free weekly email: new tech guides and tools, no spam.
New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.
One email a week. Unsubscribe anytime. See our privacy policy.







found this which may help too:
http://www.mattvsworld.com/blog/2010/01/putting-wordpress-in-subdirectory-of-site/
I can’t understand why you didn’t change WordPress URI and get this done. Since you have done it in this way, you have same content in,
quickonlinetips.com/ and quickonlinetips.com/archives/
Their is a handy way WordPress suggests to get this done without duplicate content or an addition to the URL. Here is the URL,
https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory