To install WordPress alongside an existing HTML website, you’ll need to set things up so that both the WordPress site and your HTML site can coexist on the same server.
Why might you want to to install WordPress along the side of your main HTML website? Great question! While it is more common to have WordPress installed and running your entire website, you may not want this if you already have an established HTML website. Installing WordPress and replacing your HTML website would mean redesigning your entire website.
In additional to a full website redesign, you may only want to have WordPress run the blog section of your website (that’s what we do here at BoxFly!) HTML also tends to load much quicker than a WordPress website. Of course, this depends on your theme and how well your website is coded.
There are a number of reasons why you might install WordPress along the side of your HTML website. You will have to install WordPress either in a sub-domain or a sub-directly of your HTML website. This isn’t too difficult if you have prior web hosting experience. Below are steps we have outlined to help you do this. If at any time you get stuck, you can reach out to us if you are a customer of BoxFly and we will assist at no additional cost to you!
Step 1: Set Up Your Server
Ensure that your server meets the requirements to run WordPress. Typically, you’ll need:
- PHP version 7.4 or higher
- MySQL version 5.6 or higher OR MariaDB version 10.1 or higher
- Apache or Nginx as the most robust server for WordPress
Step 2: Create a Subdirectory or Subdomain for WordPress
You’ll need to decide where WordPress will reside relative to your HTML site:
- Subdirectory: If your HTML site is in the root directory (e.g.,
example.com
), you can install WordPress in a subdirectory (e.g.,example.com/blog
). - Subdomain: Alternatively, you can create a subdomain (e.g.,
blog.example.com
) for WordPress.
To Create a Subdirectory:
- Access your server using an FTP client or through your hosting control panel’s file manager.
- Navigate to your site’s root directory (usually
public_html
orwww
). - Create a new folder, such as
blog
orwordpress
, to house your WordPress files.
Step 3: Download and Upload WordPress
- Download the latest version of WordPress from wordpress.org.
- Unzip the downloaded file.
- Upload the WordPress files into the subdirectory (or subdomain) folder you created.
Step 4: Create a MySQL Database for WordPress
- Log into your hosting control panel (cPanel, Plesk, etc.).
- Go to the MySQL Databases section.
- Create a new database and a user for WordPress, and assign the user to the database with full permissions. Take note of the database name, username, and password.
Step 5: Install WordPress
- Visit the URL where you uploaded WordPress (e.g.,
example.com/blog
orblog.example.com
). - You should see the WordPress installation screen. Choose your language and click “Continue.”
- Enter the database details you set up in Step 4.
- Complete the installation by following the prompts to set up your admin user and site details.
Step 6: Link Between WordPress and HTML Site
- From the HTML Site to WordPress: Add a link in your HTML site’s navigation or content that points to your WordPress blog (e.g.,
<a href="https://example.com/blog">Blog</a>
). - From WordPress to the HTML Site: Modify your WordPress theme’s header or footer to include a link back to your main HTML site.
Step 7: Test Your Setup
- Test the links between your HTML site and WordPress installation to ensure they work correctly.
- Make sure both parts of your site are accessible and functioning as expected.
Optional: Redirects and SEO Considerations
If you’re moving content from your HTML site to WordPress, consider setting up 301 redirects to preserve SEO value. Additionally, update your sitemap and notify search engines of your new content structure.
This setup allows you to maintain your existing HTML site while adding the flexibility and functionality of WordPress.