<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tech[niques] &#187; wordpress</title>
	<atom:link href="http://tech.niques.info/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.niques.info</link>
	<description>Technology applied to modern life</description>
	<lastBuildDate>Mon, 14 Jun 2010 11:27:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Squeezing Valid xHTML Out Of Windows Live Writer and Wordpress</title>
		<link>http://tech.niques.info/wlw-wordpress-valid-xhtml/</link>
		<comments>http://tech.niques.info/wlw-wordpress-valid-xhtml/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 11:00:02 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[windows live writer]]></category>
		<category><![CDATA[wlw]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tech.niques.info/wlw-wordpress-valid-xhtml/</guid>
		<description><![CDATA[Wordpress and Windows Live Writer are powerful blogging tools, but together they can really mess up your xHTML.  Find out how to make them work better together.]]></description>
			<content:encoded><![CDATA[Copyright © 2010 <a href="http://tech.niques.info">Tech[niques]</a>. Visit the original article at <a href="http://tech.niques.info/wlw-wordpress-valid-xhtml/">http://tech.niques.info/wlw-wordpress-valid-xhtml/</a>.<br /><div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7ecdf852-8bd1-4f81-8009-87ba7cede7b1" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/configuration" rel="tag">configuration</a>,<a href="http://technorati.com/tags/windows%20live%20writer" rel="tag">windows live writer</a>,<a href="http://technorati.com/tags/wlw" rel="tag">wlw</a>,<a href="http://technorati.com/tags/wordpress" rel="tag">wordpress</a></div>
<p>As part of my experiments with social media sites I came across the <a href="http://www.iblogstats.com" target="_blank">iBlogStats</a> site.&#160; Its a great external dashboard for your blog, but it gave me a nasty shock by highlighting I had about 50 xHTML validation errors on my homepage!</p>
<p>Over the past month I&#8217;ve found that my posts have consistently had 40 to 50 validation errors before I manually hunt them down and resolve them.&#160; All of the posts were published using a combination of Windows Live Writer (WLW) and Wordpress.&#160; While I find them to be very easy to use the lack of quality in the output (and the effort required to repair it) made me wonder whether I&#8217;d chosen the right platform for my blog.</p>
<p>Some of the errors I was experiencing:</p>
<ul>
<li>paragraph end tags with no begin tag </li>
<li>div tags surrounded by paragraph tags </li>
<li>attribute construction errors where a title attribute had been moved within hyperlink, and had been concatenated with the href attribute instead of relocated after it</li>
<li>img tags that weren&#8217;t properly terminated </li>
</ul>
<p>&#8230; and the list goes on.&#160; To make matters worse I couldn&#8217;t resolve the errors directly in the Wordpress online editor because it insisted on converting div tags to paragraph tags, destroying the visual style of the posts in the process!&#160; I had to maintain a copy of the original post HTML elsewhere, edit it in a text editor then paste the repaired HTML over the existing content shown in the Wordpress editor.&#160; A rather tedious process.</p>
<p>A little time on Google found some tips that have dramatically improved the quality of automatically generated xHTML:</p>
<ul>
<li><strong>Turn off the visual editor in Wordpress</strong>:&#160; <br />(via <a title="WordPress Visual Editor - Do you Use It?" href="http://weblogtoolscollection.com/archives/2007/09/21/wordpress-visual-editor-do-you-use-it/" target="_blank">Weblog Tools Collection</a> and <a title="WordPress - Taming The Advanced Editor" href="http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/" target="_blank">More than scratch the surface</a>)&#160; <br />In Wordpress&#8217;s admin interface, switch to the users tab and edit your current user. Uncheck the &quot;Use the visual editor when writing&quot; option.&#160; This resolves the &quot;div converted to paragraph tag&quot; issue mentioned above, and various other errors introduced when Wordpress &quot;fixes&quot; your HTML, so validation errors can now be repaired online. </li>
<li><strong>Configure Windows Live Writer to publish xHTML</strong>:       <br />(via <a title="Writer now supports XHTML* (emphasis on the asterisk)" href="http://jcheng.wordpress.com/2007/09/05/writer-now-supports-xhtml-emphasis-on-the-asterisk/" target="_blank">whateverblog</a>)       <br />Windows Live Writer did such a good job of detecting my blog settings that I didn&#8217;t even think of manually configuring it to publish xHTML.&#160; How embarrassing! In WLW select the Weblog\Edit Weblog Settings menu item.&#160; Open the Advanced configuration options pane.&#160; Make sure &quot;Markup Type&quot; is set to XHTML. </li>
<li><strong>Be careful where you &quot;Insert Tags&quot;</strong>      <br />If you use the Web Layout view to write your post, be careful where you call the &quot;Insert Tags&quot; feature.&#160; WLW uses paragraph tags and non-breaking space to add blank lines to your post.&#160; If you are not careful you might insert your tags after a non-breaking space on a blank line and inadvertently wrap the tag&#8217;s div directly within paragraph tags.&#160; When you <a title="W3C&#39;s xHTML Validator" href="http://validator.w3.org/" target="_blank">validate</a> the results this will be highlighted as an error.</li>
</ul>
<p>While some errors remain the volume is more manageable (a couple per post) and they tend to be easier to resolve.&#160; The most painful one remaining is the &quot;attribute construction error&quot; but it is looking more and more like this has been introduced by one of the plugins I&#8217;m using.&#160; I&#8217;ll continue debugging my configuration and report back if I ever manage to track this last major bug down!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Ftech.niques.info%2Fwlw-wordpress-valid-xhtml%2F';
  addthis_title  = 'Squeezing+Valid+xHTML+Out+Of+Windows+Live+Writer+and+Wordpress';
  addthis_pub    = 'DawMatt';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://tech.niques.info/wlw-wordpress-valid-xhtml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving Your Wordpress Blog to a Different Directory</title>
		<link>http://tech.niques.info/change-wordpress-directory/</link>
		<comments>http://tech.niques.info/change-wordpress-directory/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 02:18:29 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tech.niques.info/change-wordpress-directory/</guid>
		<description><![CDATA[Installing Wordpress into a sub-directory can impact blog branding and operation of plugins.  Find out how to safely move it to become the focus of your site.]]></description>
			<content:encoded><![CDATA[Copyright © 2010 <a href="http://tech.niques.info">Tech[niques]</a>. Visit the original article at <a href="http://tech.niques.info/change-wordpress-directory/">http://tech.niques.info/change-wordpress-directory/</a>.<br /><div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a02b9c22-29a4-4d2c-ab84-4266edcbc97d" style="margin: 0px; padding: 0px; display: inline; float: none">Technorati Tags: <a href="http://technorati.com/tags/backup/" rel="tag">backup</a>, <a href="http://technorati.com/tags/blog/" rel="tag">blog</a>, <a href="http://technorati.com/tags/configuration/" rel="tag">configuration</a>, <a href="http://technorati.com/tags/wordpress/" rel="tag">wordpress</a></div>
<p>Best practice for self-hosted blogs is to install your software in the site&#8217;s main directory instead of a subdirectory.  It may seem a small issue but not doing so dilutes the value of your site identity and brand.  After all a site called http://tech.niques.info/blog/ would indicate the blog is just a part of a larger site, not its primary focus.  That would send mixed messages to your audience.</p>
<p>Unfortunately I was thinking about technical maintenance instead of branding when I originally setup this site and installed into a subdirectory.  While Wordpress gives you options to cloak this fact, I was beginning to find that some plugins didn&#8217;t cope well with the configuration.  So I decided to &#8220;bite the bullet&#8221; and move the installation to the root directory for the site for technical as well as branding reasons..</p>
<p>A quick scouring of the net turned up madteckhead&#8217;s <a href="http://www.madteckhead.com/blog/2007/05/25/wordpress-22-server-migration/trackback/" title="Wordpress 2.2 Server Migration" target="_blank">Wordpress 2.2 Server Migration</a>.  While some other articles seemed to more closely mirror my problem I found them to be a little too simplistic and wasn&#8217;t confident they would work.  So I&#8217;ll be describing how I adapted madteckhead&#8217;s instructions to safely migrate Wordpress between directories on the same server.</p>
<p>The instructions will assume Wordpress is installed immediately below the root directory for the website (e.g. in http://tech.niques.info/blog/), and you have write access to the directory containing the root directory for the website. The examples will use the following directory structure.</p>
<p><code>. /<br />
./oldrootdir/<br />
./oldrootdir/currentwordpressdir/<br />
./newrootdir/<br />
./oldrootdir-backup/ </code></p>
<h1>Instructions</h1>
<p><strong>Note</strong>: You will need to adjust the instructions to reflect the directory structure of your site.</p>
<ol>
<li>ssh to your server and navigate to the parent directory for your Wordpress installation.  Backup the current installation files using a command like:
<p><code>cd ./oldrootdir/<br />
tar -cvf ../wordpressbackup.tar currentwordpressdir/ </code></p>
</li>
<li>Move up a directory level (i.e. to the directory above the website), then restore the files.  Rename the resultant directory to be the new root directory for the website: <code>cd ..<br />
tar -xvf wordpressbackup.tar<br />
mv currentwordpressdir/ newrootdir/ </code></li>
<li>Copy the contents of the current website root directory across to the new directory.  This ensures your .htaccess, robots.txt and other key files make it across to the new directory: <code>cp oldrootdir/* newrootdir/<br />
cp oldrootdir/.* newrootdir/ </code></li>
<li>Change to the new website root directory. <code>cd newrootdir/</code> The following line needs to be changed in the wp-config.php file to reflect the new database we will create: <code>define('DB_NAME', 'newdatabasename'); // The name of the database </code></li>
<li>Log into phpMyAdmin for your database server.  Select the Export option, ensure the current Wordpress database is selected and that the export uses the SQL format, then export the database to a file.  For safety&#8217;s sake I would recommend that you <strong>do not use the &#8220;Add DROP DATABASE&#8221; option</strong>.</li>
<li>Take a copy of the export file.  Using your favourite text editor, you will need to find and replace a number of items in the file:<br />
<table border="0" cellpadding="2" cellspacing="0" width="476">
<tr>
<th valign="top" width="127">Reason</th>
<th valign="top" width="199">Old Value</th>
<th valign="top" width="148">New Value</th>
</tr>
<tr>
<td valign="top" width="127">Create a new database</td>
<td valign="top" width="199">CREATE DATABASE `olddatabasename&#8217;`</td>
<td valign="top" width="149">CREATE DATABASE `&#8217;newdatabasename&#8217;`</td>
</tr>
<tr>
<td valign="top" width="127">Change directory</td>
<td valign="top" width="199">server/currentwordpressdir/</td>
<td valign="top" width="149">server/</td>
</tr>
<tr>
<td valign="top" width="127">Update Blog Address option</td>
<td valign="top" width="199">&#8217;siteurl&#8217;, &#8216;http://server/currentwordpressdir</td>
<td valign="top" width="149">&#8217;siteurl&#8217;, &#8216;http://server&#8217;</td>
</tr>
</table>
<p>If you didn&#8217;t use the Wordpress Blog Address option then you can skip the last change above.</p>
</li>
<li>In phpMyAdmin go back to the home page and select the Import option.  Import the file you have just edited and it will create the new database referred to in step 4), and populate it with your current Wordpress data.</li>
<li>Move up a directory level (i.e. to the parent directory for the website), then switch the swap the old and new versions of the website: <code>cd ..<br />
mv oldrootdir/ oldrootdir-backup/<br />
mv newrootdir/ oldrootdir/ </code></li>
<li>Test you blog.  Make sure that:
<ul>
<li>Your homepage functions</li>
<li>Individual posts display correctly, including the pictures</li>
<li>Individual pages display correctly, including the pictures</li>
<li>RSS feeds are valid</li>
<li>Admin pages are accessible</li>
</ul>
<p>When testing pay particular attention to any plugins that rewrite URLs to make sure they are still operating OK.</p>
</li>
<li>If something is broken normal troubleshooting rules apply. Slowly disable extensions in the impacted area until things are working again, then either update the configuration for the plugin or widget, reinstall it, or find an alternative that does work. In my case my sidebar died, but after removing widgets one at a time I discovered the &#8220;Text 1&#8243; widget was the culprit. Removing the widget then adding it again resolved the problem.</li>
</ol>
<p><strong>Note</strong>: If you encounter an issue you are unable to resolve, reversing the changes made in step 8 will restore your previous installation to working order,</p>
<p>Once you have successfully moved your Wordpress installation there are a couple of other items you will need to consider:</p>
<ul>
<li>If you have a robots.txt file you will need to confirm it is still valid given the changed website layout   <a href="https://www.google.com/webmasters/tools/" title="https://www.google.com/webmasters/tools/" target="_blank">Google Webmaster Tools</a> can help you with this.</li>
<li>If you did not use the Wordpress Blog Address option to hide the previous location of your installation, your permalink structure will be broken by this move.  You can either try <a href="http://scott.yang.id.au/code/permalink-redirect/trackback/" title="Scott Yang's Permalink Redirect plugin to redirect requests from the old Permalink structure" target="_blank">Scott Yang&#8217;s Permalink Redirect plugin to redirect requests from the old Permalink structure</a>, update your Permalink structure to reflect the old location of your archives, or manually update your .htaccess file to redirect old permalink requests to the new location.</li>
</ul>
<p><a href="http://www.bigbizblog.com/archives/2005/01/06/moving-your-wordpress-blog-to-a-new-directory/">There have been other posts</a> describing how to move Wordpress between directories but these tend to be destructive processes that are difficult to back out if things go wrong.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Ftech.niques.info%2Fchange-wordpress-directory%2F';
  addthis_title  = 'Moving+Your+Wordpress+Blog+to+a+Different+Directory';
  addthis_pub    = 'DawMatt';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://tech.niques.info/change-wordpress-directory/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
