Produced by KelbyOne

Editing a WordPress blog with Dreamweaver CS5

One of the most dramatic improvements to Dreamweaver CS5 is the ability edit WordPress themes, but before you can get WordPress (or Joomla! or Drupal) to work, you’ll need to set up your computer as a Web server. It’s a lot of technical steps, but once you get all this set up, you’ll be able to use all of the great design tools in Dreamweaver.

To run WordPress, you need a Web server, a MySQL database, and PHP installed on your local computer. It’s also best to have the Firefox Web browser, so be sure to install it if you haven’t already. On a Mac, you can get everything you need in one nifty package at If you’re on Windows, go to Because of the limited space in this column, these steps are specific to the Mac, but the process is similar for both platforms (and you’ll find special instructions for Windows users in the Dreamweaver Help Center on my site at

After you download, install, and launch MAMP, a little window opens with controls to turn the Apache server and MySQL database on and off. Give them a second to get going and MAMP will launch the Firefox Web browser. If the browser doesn’t open automatically, click on the Open Start Page button. You’ll know that the server is working on your Mac when you see the Welcome to MAMP screen in your browser window and http://localhost/8888/MAMP in the address bar.

This is an optional step to remove the 8888 from the local URL: In the small, floating MAMP window, click Preferences, then click the Ports tab, and click the Set to Default Apache and MySQL Ports button. This changes the port from 8888 to 80. Click OK. Anytime you make a change to the server setup, or if things just don’t seem to be working right, restarting the server often fixes the problem. Click the Stop Servers button, wait a minute, and then click the Start Servers button to restart the server. Click the Open Start Page button to refresh the browser with the simplified URL.

Next, you need to create a database. Don’t worry, it’s not as hard as you may imagine because WordPress builds all of the tables for you. With MAMP open in Firefox, click on the phpMyAdmin tab at the top. In the Create New Database Field, enter a name (don’t use spaces or special characters). Make note of the name. Better yet, copy it so you can just paste it into WordPress when you get to Step 8 (you’ll need to enter it exactly). Click the Create button and you’ve created a database (WordPress takes care of the rest).

Next, go to (not and download WordPress (it’s free and it’s a quick download.) Unzip the WordPress folder and you’ll find all of the files and subfolders for a new blog. There’s really nothing to install but you’ll need to copy these files into the root folder of your local Apache Web server. On a Mac, the htdocs folder inside the MAMP folder inside the Applications folder is the root folder of your local server. (More on copying these files into the htdocs folder in the next step.)

If you’re creating a single blog, simply copy all of the files in the WordPress folder you unzipped into the htdocs folder (inside the MAMP folder). If you’re working on multiple blogs, or if your blog is part of an existing Dreamweaver site and you want to work on all of the files together, you can create subfolders in the htdocs folder. Then copy the entire WordPress folder into the subfolder within htdocs as well as any Dreamweaver site files. This way you can work on them together in the same root folder in Dreamweaver.

Now it’s time to open the blog in a Web browser on your computer. Make sure that the Apache server and MySQL database are still running in the background (you can always check the floating MAMP dialog). In Firefox, enter the URL: http://localhost/ followed by any subfolder names you added to the htdocs folder. Note: The http:// isn’t optional, and you don’t use www. Also note: If you didn’t change the preferences in Step 3, you’ll still need the 8888, so your URL would be something like this: http://localhost/8888/foldername. Don’t panic when WordPress returns an error.

Click the Create a Configuration File button and follow the WordPress instructions. On the screen where you have to enter the name of the database, enter the exact name you entered when you created the database in Step 4. In both the MySQL User Name field and the Password field enter “root.” Note: All MySQL databases come with the user name and password “root.” Unless you’re worried about someone hacking your blog on your local computer, there’s no reason to change them. Leave the last two fields in the WordPress setup page as they are and click Submit.

Click Run the Install button and fill in the WordPress Welcome screen. I recommend you don’t use “admin” as the Username and that you take note of your user name and password because you’ll need them to access your blog even on your local computer. Follow the rest of the WordPress instructions and you’ll soon find yourself at the WordPress Dashboard. From here you can do all the things on your local computer that you can do on a remote server with a WordPress install, including creating and editing posts, downloading and changing themes, adding plug-ins, etc.

Once you have the Apache server and MySQL database working and you’ve installed WordPress, you can set up your blog so that you can edit it in Dreamweaver. You set up a blog much as you would set up any site in Dreamweaver. Choose Site>New Site. Give the site a name (this name is just for your reference). Click on the Browse for Folder icon at the far right of the Local Site Folder field and browse to find the htdocs folder in your MAMP folder in the Applications folder. If you created a subfolder for your site, select that folder. Don’t click Save yet.

With the Site Setup dialog still open, click the Servers category on the left. Click on the small plus sign (+) near the bottom of the servers dialog to add a new server (just as if you were setting up a remote server connection). Enter a name, such as “Testing Server” (again this name is just for your reference). From the Connect Using drop-down list, choose Local/Network (not FTP). With Local/Network selected, the rest of the options will change. Again, use the Browse icon (folder) to find the site folder. If you didn’t create a subfolder, it should be Applications/MAMP/htdocs.

In the Web URL field at the bottom of the Server Setup dialog, type http://localhost/ (again, adjust this name to include any subfolder names you may have added to the htdocs folder.) Note: You’ll need to add 8888 if you didn’t change the preferences in MAMP in Step 3. Click Save. The dialog closes and the server is added to the Servers list in the Site Setup dialog. Important: Next to the server name are two checkboxes for Remote and Testing. Uncheck Remote and check Testing. Then click Save to complete the setup.

Choose File>Open and select the index.php file in your WordPress blog folder (you can also open it by double-clicking on the index.php page in the Files panel). Expect a blank screen—this doesn’t mean you’ve made a mistake (necessarily). In tiny text at the top of the workspace, look for the message: This page may have dynamically-related files that can only be discovered by the server. Click the Discover link, then click Yes. Finally, click the Live View button at the top of the workspace to make Dreamweaver act like a Web browser and display the dynamic WordPress page.

If you got through all those steps, congrats! Setting all that up is complicated, but you only have to get it right once. Dreamweaver saves your server settings and you can now take advantage of all of the wonderful CSS and PHP features in Dreamweaver to edit your blog theme. (Note: You still want to create and edit posts in the WordPress Dashboard.) When you get the theme design the way you want it, you can copy just the CSS file to your remote Web server, or use the WordPress export/import features to move the entire blog from your local server to a remote server.


  • James says:

    MAMP Pro = Fantastic…

  • Melissa says:

    Thank you so much for this!

  • Marcus says:

    Thanks for your excellent tutorial. However, I seem to have a nagging problem: I always seem to get this message on opening any index.php file: “An unknown error occured while discovering dynamically-related files”. Would you have any ideas on what I am doing wrong?

  • Editing wordpress with dreamweaver explanation is very good and useful.can u explain how to use style sheet in worpress ?

  • Mark says:

    Great tut, Thanks.

    Can I use Dreamweaver to edit files WordPress Theme files that are on a live web server?

    Currently I use a combination of Coder and Firefox’s web developer plugin, but would love to try editing themes with Dreamweaver.

    Any guidance would be appreciated.



  • Umer says:

    Fantastic Editing.
    thankx …..

  • betty says:

    Thank you so much for this!

  • Matt says:

    Though you can setup a local server and run you WP files from it locally, there is still a great deal of knowledge needed to navigate the code and be able to make changes to your theme. Setting up MAMP would seemingly be something you would know prior to being capable of making changes to a WP theme.

  • Ed says:

    Does it NEED to be the root of MAMP. I already testing a lot of sites offline. I would like to setup several folders in MAMP root for each project. (or better, point MAMP to my existing sites folder)

    And for Windows, applies all above to WAMP?

  • Dean says:

    Okay I already have a live wordpress blog, self hosted.
    I have Dreamweaver, I have installed XAMPP it is running.
    But how do I get the live edited theme / blog into dreamweaver then out again? Once I have edited my theme.

  • Arnold says:

    I just found a solution for the error message: “An unknown error occured while discovering dynamically-related files”

    It is as Janine said: “Note: You’ll need to add 8888 if you didn’t change the preferences in MAMP in Step 3. Click Save.”

    So in the servers | weburl you’ll need to add:


    and it works!

  • chris says:

    I also keep getting an error when trying to “discover” dynamic files after opening index.php. Please help, and suggestions?


  • Consuela says:

    I think I love you a little bit!

  • Beate says:

    To work in Dreamweaver with wordpress themes is very very helpful! Thanks for this instructions!


  • Fernando says:

    This is the very best solution to connect DW and WP I’ve ever read. Congrats! And thanks a lot for the instructions!

    Cheers from Spain 😉

  • Abigail says:

    Thank you so much for this! Wonderful, wonderful – and fairly easy – tutorial. I would have been so lost without this. Thanks, again!

  • Janine, thanks for the easy to follow instructions. Is it possible for me to import existing wp files from godaddy server and mock up new site design and return files to godaddy server?

  • Kenneth John says:

    I have followed it all and its working fine, the output on my Dreamweaver is same as the one mentioned in this tutorial but I cannot access the inner pages in worpdress is it possible and if it is then how?