Search

Recent Posts

Tags


« | Main | »

Steps for Importing Static HTML into WordPress

By Dale Reagan | February 12, 2010

As previously posted if you have a small web site (i.e. fewer than 20 pages) then manually copying your pages and uploading your images/media might be the best & simplest solution to moving to a WordPress solution.  If you have more than pages & media files than you care to manually upload then you might want to us a strategy like the following to ease the migration.

A little WordPress background

Start with a site structure review of your current web

Decide on pure text or limited/custom HTML markup

Edit your static HTML files (i.e. via a stream editor like ‘sed’) to remove/replace any troublesome markup.   Look for repeated sections that can be removed, .i.e it was common with older HTML pages to use tables to provide structure – perhaps the top row is your ‘header’ and the bottom row is your ‘footer’ – split the file and remove theses duplicated sections.  You may also want to use a tool like tidy (HTML tidy) to ‘clean’ the HTML markup.

During media import WordPress will attempt to resolve (remove/replace) the special characters listed below – these characters can cause problems for proper operation of general functions which may not know how to deal with them, hence you should avoid them.  In general you will have fewer file name-related issues if you limit file names to using upper and lower case letters, numbers, dashes, underscores, and periods.  Avoid using special punctuation marks or special symbols (i.e. avoid using any symbol that can only be typed by using the ‘shift key’.)

** Special characters to AVOID in file names (this may  vary depending upon your operating system):

After renaming your files and deciding on your structure you are almost ready to import.  I have not found an import utility that will pull in both media and web page (text) content – so you have to decide:

Option A (semi-auto import – needed for large number of files/media)

An example – you have a static HTML file with a link to the image file: Some_IMAGE.jpg.  After import into WordPress, the file is referenced as:

http://YOUR_NEW_DOMAIN/wp-content/uploads/2010/02/Some_IMAGE.jpg

So, prior to importing your static HTML file that uses the above image file you would change the HTML code to point to the new location of the image, i.e. if the file that you want to import contains an image link like:

<a href=”/some_path/Some_IMAGE.jpg>

it needs to be changed to:

<a href=”http://YOU_NEW_DOMAIN/wp-content/uploads/2010/02/Some_IMAGE.jpg”>

Of course, you can manually edit the new WordPress page after importing but using a process similar to the above your image(s) should be present in your converted pages/posts.

Option B (manual import – fine for a few pages)

Need help with a similar HTML to CMS, small or large project?  (hourly or project based rates.)


Responding to a comment from Bryce:
Thanks for dropping by… When I first reviewed WordPress (and other, Open Source publishing solutions) I quickly noted the lack of a complete import solution. There is no simple approach for this type of project – my solution involves using tools that are customized (which automate most of the import) for each such project. I am guessing that the 1500+pg site could probably be broken down by page types – you could categorize them and then create an import process for each type. The typical questions for these types of projects include:

My approach starts with an analysis of such a site (HTML based.) I categorize the pages (i.e. auto-import, manual-import) and estimate the hours needed to complete the import to WordPress (or other DB based solution) process. In some instances the auto-import pages are sub-categorized (require special handling) so I may wind up with similar, small software-data-import-tools to ease the process.   Good luck with your project, and yes, I would be happy to provide a  review & estimate for your project.  🙂

Topics: Computer Technology, Problem Solving, Web Site Conversions, Web Technologies, Wordpress Software | 1 Comment »

One Response to “Steps for Importing Static HTML into WordPress”

  1. Bryce Says:
    March 22nd, 2010 at 1:24 am

    Hello,

    Thank you for your article, it was an interesting read if anything. However, I don’t really see how this is making migrating your static html site any easier into a WordPress website. With all the editing that would be required in the HTML pages before making the migration, it seems it would be just as easy to edit the copy and pasted text from within your post / page editor.

    Right now I’m in the middle of searching for a way to migrate an HTML blog that has over 1500+ pages to a wordpress website and having a hell of a time discovering the best method. I do appreciate the article but don’t think it really gives much ease to the process.

    Kind regards,
    Bryce


________________________________________________
YOUR GeoIP Data | Ip: 73.21.121.1
Continent: NA | Country Code: US | Country Name: United States
Region: | State/Region Name: | City:
(US only) Area Code: 0 | Postal code/Zip:
Latitude: 38.000000 | Longitude: -97.000000
Note - if using a mobile device your physical location may NOT be accurate...
________________________________________________

Georgia-USA.Com - Web Hosting for Business
____________________________________