Archive for the ‘Yoast’ Category
Yoast: Change domain, and warn your visitors
When you change domains, for instance using my moving WordPress to a new domain guide, you’ll usually redirect your visitors with something looking like this:
Redirect 301 / http://new.example.com/
The only issue with this is that people might not notice that you’ve moved to a new domain, and thus might not update their links to you. As Matt Cutts confirmed a while back that 301 redirects do not pass full PageRank, and they seem to take a hell of a time to kick in these days, that’s somewhat of an issue: we’d rather have people update their links.
The proper redirect
So we want to tell people that you’ve moved to a new domain, but only people who came through old links to your site. And we still want to keep that 301 redirect in place, to preserve as much of the value from the old site as we can.
So, what if we redirected to http://new.example.com/#moved? The search engines don’t care about anything from the hash onwards, so the value of the redirect would still be maintained. We could then use javascript to detect the value of the hash tag, and display a notice to our visitors.
There’s an issue with that as well though: with the redirect 301 / line above, we redirected everything after /, to new.example.com/, so for instance /test/ would be redirected to new.example.com/test/. If we added #moved to the end of that URL, we would end up with new.example.com/#moved/test/ and that wouldn’t work. So we’ll need to make a bit of a fancier redirect:
RedirectMatch 301 /(.*)? http://new.example.com/$1#moved
That should work. Notice though that when you have code in place adding a / to the end of your URL’s if not existent, that code should conserve any hash tags in the URL.
Showing the domain move message
So now, let’s move on to the javascript part to actually show people a “we’ve moved” message, which is actually pretty simple. You create a div with the message you want to show, and put it in your footer, something like this:
<div id="domainmovemsg" style="display:none;"> We've moved from old.example.com to new.example.com, please update your feeds & links! </div>
As you can see, we default it to display: none; so not everybody sees it, and then you add this tiny snippet of javascript, also in the footer of your page, after you’ve loaded the div above:
if (document.location.hash == '#moved') { document.getElementById('domainmovemsg').style.display = 'block'; }
Example code
I’ve coded an example of this with some more styling etc., which you can find here. If you want to see it in action immediately, you’ll have to click this link.
Change domain, and warn your visitors is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: Happy Birthday BuySellAds!
I’ve posted about them before, and will probably be telling everybody I can about them for a while to come: BuySellAds. It’s their second birthday today, and they made a pretty darn cool video to celebrate:
Click here to view the embedded video.
A very happy “birthday” to Todd and the crew at BuySellAds, thanks for helping me and those other great sites out there make money so we can continue to serve the community!
Happy Birthday BuySellAds! is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
WordPress Podcast: WordPress does Windows
Josh Holmes is a UX Architect Evangelist at Microsoft.com, where he works hard to bridge the gaps that exist in technology adoption and Microsoft and open source projects. In the past, Josh used DasBlogML and he migrated it to WordPress quite easily. On the show, Josh shared with us many of the projects and contributions Microsoft is making to the WordPress community. Among those plugins created by the Microsoft team is Windows Azure Storage for WordPress with is similar to Amazon Web Services or Rackspace Cloudfiles. Among the more interesting was learning how WordPress can be run using Microsoft SQL Server for the database store as shown on sites like oddlyspecific.com for example with performance enhancements. Josh also highlighted some of the steps Microsoft is taking to make deployment of their technologies easier using the Microsoft Web Platform, which is quite a solid offering.
For those of you that are diligent developers or up for a challenge you may want to try the Toughest Developer Puzzle Ever.
In news:
- WordPress 3.0 release candidate is now available and looking good.
- Encouraging constructive feedback for the developers that make the WordPress community so rich and free.
Plugin picks of the week:
Yoast: Using WordPress as a CMS article series
I picked the winner for the ShopHTML competition today, a winner who asked for a post I can not possibly do in one single post. So I’ve started an article series on the topic: using WordPress as a CMS, and am ready to release the first article to you already: going from your website’s goal to its site structure.
This doesn’t touch on WordPress as much as on general site design principles, but as these steps are often misunderstood and they very much determine whether your site is ever going to be successful, I decided it needed to be in there. The next article in the series will be more WordPress focussed, going on about design, and turning a design into a theme and more. Stay tuned for that, but for now, start reading: Your website: from goal to structure.
Using WordPress as a CMS article series is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
Yoast: Two WordPress SEO Plugins you should NOT be using
I was reading my backlog of feeds just now, and came across a couple of updated WordPress SEO plugins aimed at improving your site’s SEO. Some people are just plain ^%$#*& stupid, I’m sorry to say.
Let me show you what got me so wound up:
#1 Canonical Link Plugin
This Canonical Link plugin consists of the following code:
function canonicalink() { $request_uri = parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH); echo "<link rel="canonical" href="http://{$_SERVER['HTTP_HOST']}{$request_uri}" />"; } add_action('wp_head','canonicalink',1,1);
If you know PHP, you can see what it does: it parses the current URL, strips out URL variables (if you’ve got any) and displays the current URL as the canonical link element. Of course the easy way would have been to do this:
function canonicallink() { global $post; echo '<link rel="canonical" href="'.get_permalink($post->ID).'"/>'; }
This would not rely on the current URL being ok, because it doesn’t necessarily have to be. This would have been a better solution. Were it not for one simple thing: WordPress does this by freaking DEFAULT. Check out rel_canonical if you don’t believe me. It was added in WordPress 2.9. Why this get’s me wound up? Because the plugin author updated his plugin today, and updated the readme.txt to tell everyone that the plugin is compatible with WordPress 2.9.2. That’s just bloody stupid.
Ow yeah I do have a canonical plugin myself, it allows you to set a different canonical URL for a post, quite useful, actually
#2 All in One Webmaster
This plugin allows you to do things that other SEO plugin which is not “All in One” either, with or without a premium option, has been lacking for years. While it’s not as stupid as #1, the features might actually be useful to some people, I hate the fact that people call their stuff “All in One” when they’re obviously not.
Bonus #3: All in one SEO pack
All in one SEO is not bad. It’s just not “all in one” either. And it has a feature I loathe: automatic generation of meta descriptions. If he’d remove that feature I might actually not diss his plugin all the time
Confession: I’m looking into all these because I’m working on a new SEO plugin myself. Stay tuned for more info on that.
Two WordPress SEO Plugins you should NOT be using is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
WordPress Podcast: WordPress does Windows
Josh Holmes is a UX Architect Evangelist at Microsoft.com, where he works hard to bridge the gaps that exist in technology adoption and Microsoft and open source projects. In the past, Josh used DasBlogML and he migrated it to WordPress quite easily. On the show, Josh shared with us many of the projects and contributions Microsoft is making to the WordPress community. Among those plugins created by the Microsoft team is Windows Azure Storage for WordPress with is similar to Amazon Web Services or Rackspace Cloudfiles. Among the more interesting was learning how WordPress can be run using Microsoft SQL Server for the database store as shown on sites like oddlyspecific.com for example with performance enhancements. Josh also highlighted some of the steps Microsoft is taking to make deployment of their technologies easier using the Microsoft Web Platform, which is quite a solid offering.
For those of you that are diligent developers or up for a challenge you may want to try the Toughest Developer Puzzle Ever.
In news:
- WordPress 3.0 release candidate is now available and looking good.
- Encouraging constructive feedback for the developers that make the WordPress community so rich and free.
Plugin picks of the week:
Yoast: hreview and hproduct in Magento
Today I gave a presentation at Meet Magento in the Netherlands, talking about SEO for Magento. Up until this point, all articles about that subject here on Yoast have been written by my colleague Joachim Houtman. Last week though, I started playing with Magento myself, in preparation for this presentation today, and I’ve added some things to our Blank SEO Template that I know some of you will enjoy.
What I’ve done is I’ve added both hreview and hproduct microformats to our template. I’ll briefly walk you through how to do that. It might be wise to start with Frederick’s post on Driving more traffic from Google through Microformats. After that you can read my own post on how to implement hreview in WordPress or read on to see how to implement hreview-aggregate in Magento.
Adding hreview in 5 steps
Step 1: the ‘hreview-aggregate’ class
Because we’ve got more than one review for products, we’re going to be using the hreview-aggregate version of the microformat. This wrapper class should be on an element that contains all the elements of the review. So we open:
template/catalog/product/view.html
And add the class hreview-aggregate to the product-shop div.
Step 2: the “item” reviewed
The second thing we should add is the item being reviewed, we’ll use two classes here: item and fn. I’ve added this to the <h1> within the product-name class, still in the same file. So far, what we’ve got looks like this:
<div class="product-shop hreview-aggregate"> <div class="product-name"> <h1 class="item name fn"> <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?> </h1> </div>
Step 3: the rating
Then you’ll see a call like this:
<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
This calls to a template file that’s hidden in:
/template/review/helper/summary.phtml
If you open this file you’ll see a div called rating-box, containing a div called rating. Because this box outputs the rating visually using CSS, we’ll need to make it machine readable as well. Luckily, there’s a solution for that: we’ll use the value-title method. Within the contents of the div with class rating, we’ll add this:
<span class="value-title" title="<?php echo number_format($this->getRatingSummary() / 20,1); ?>"> </span>
As you can see, we retrieve the rating and turn it into a 5 point scale rating by dividing it by 20, so Google can understand it.
Step 4: the review count.
Next we have to tell Google how many reviews we’ve had for this product. In a span in the same file with the class amount, you’ll find this info. I had to redo the code a tiny bit, it ended up looking like this (formatted for readability):
<?php echo '<span class="count">'; echo $this->getReviewsCount(); echo '</span>'.$this->__(' Review(s)'); ?>
So with the span count it only shows the number, the text “Review(s)” is actually outside of it. Otherwise Google wouldn’t understand it.
Step 5: The pricerange
This last step actually caused me a bit more headaches, even though the end result is quite simple. We need to add the pricerange class to our price “tag”, in order for Google to understand the pricing of our product. To do this, we open up:
/template/catalog/product/price.phtml
This is one big file, but don’t get scared: there are two divs there with class price-box, just add the pricerange class there and you’ll be ok, and quickly close that file before that code get’s to your head!
Adding hproduct to your template
Step 1: The hproduct class
Open up view.phtml again:
/template/catalog/product/price.phtml
The hproduct class needs to go up in the source a bit higher than the hreview class, easiest way is to add it to the div with class product-view.
Step 2: Availability
The fn is already there because of our hreview implementation, so we can go right to availability. To add the proper classing open up:
/template/catalog/product/view/type/simple.phtml
You’ll see that the class in there is already called availability. It’s there twice: for in stock and out of stock occasions. The full code I made out of that uses the value-title method, and looks like this:
<?php if($_product->isSaleable()): ?> <p class="availability in-stock"> <?php echo $this->__('Availability:') ?> <span class="value-title" title="<?php echo $this->__('In stock') ?>"> <?php echo $this->__('In stock') ?> </span> </p> <?php else: ?> <p class="availability out-of-stock"> <?php echo $this->__('Availability:') ?> <span class="value-title" title="<?php echo $this->__('Out of stock') ?>"> <?php echo $this->__('Out of stock') ?> </span> </p> <?php endif; ?>
Now I’ll be honest: I have second thoughts about giving Google availability data for products. If Google were to act in the best interest of it’s endusers, it would not show you in the rankings for a particular product when there were other sites that carried the same product that indicated they do have stock. So, use this part of hproduct with some prejudice.
Step 3: The product photo
Next up is the product photo. Open up:
/template/catalog/product/view/media.phtml
You’ll see an img element with the id image, give it two classes: photo and fn. Some microformats parsers might have issues with using the fn from the hreview, and since this image contains the exact same title as an alt tag, adding the fn class here will help those parsers.
Step 4: Price
This step is easy: the default theme already has the class price around the price everywhere, so just leave it as is and you’re good, otherwise, open up price.phtml and add it in.
Step 5: Brand
The last step to our hproduct completion is to add the brand. Open up:
/template/catalog/product/description.phtml
We’ll use the fact that brand is an internal attribute name in Magento as well for this. Where it has a td with class data, change it into this:
<td class="data <?php echo strtolower($_data['label']); ?>">
By doing this all the data cells will have a proper class name, one of which will be brand, completing our hproduct microformat!
My presentation from Meet Magento
Microformats in Magento
So if you’ve followed the steps above, you should now have a nicely microformatted product page. Use Google’s Rich Snippets testing tool to test it, and have a lot of fun using it!
Downloading the updated template
So we’ve done all this in the updated version of our template, as well as added these same microformats to the product overview pages like categories. I know you want to play with it, but we’re finishing up on some stuff in it and haven’t released it. We will probably release it for you all to enjoy this week though!
hreview and hproduct in Magento is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
WordPress Podcast: Killer Search Marketing Tips
Vanessa Fox is a seasoned speaker, blogger and now writer. While at Google she worked on Webmaster Central and led the way on creating lots of the great features that make it easier to understand how Google sees your sites. On this week’s show we discussed: her new book on marketing in the age of Google, common SEO pitfalls to avoid, and search engine optimization tips in particular about helping search engines discover your content, using related articles and internal linking and a smart XML sitemap strategy.
Also touched upon is the use of keyword research tools for businesses, bloggers, and basically anyone out there who has a website and wants it to be found. Vanessa points at a great list of keyword research tools she has on her site.
The news section this week included highlighting of a couple videos from WordCampTV from Jonathan Dingman and Daryl Koopersmith. In addition, the BuddyPress update was just released and comes highly recommended.
Plugin picks of the week:
Killer Search Marketing Tips is an episode of The WordPress Podcast, which is a weekly podcast hosted by Joost de Valk and Frederick Townes.
Yoast: Outsource slicing & coding of your WordPress themes
In last nights episode of the WordPress Podcast we discussed setting up a website for small businesses in WordPress. One of the things I touched on in that discussion is that we outsource a lot of our development work, especially slicing PSD’s to HTML or even directly to WordPress themes, both for Yoast and for OrangeValley.
I thought it might be useful for all of you to share with you which company we use for that. We’ve worked with several of them, some of them good, some of them not so good, but we’ve had the best experience working with a company called ShopHTML.
The difference, for projects that we do, is in the level of customization teams are able to do to a theme without having to be told specifically what to do. If we include star ratings in a design, ShopHTML will usually come back to us and say “hey, we’ve got this solution, would that work for you” instead of just adding the stars as images into what actually should be a fully functional WordPress theme.
Win a free PSD to WordPress Theme conversion!
I talked about sharing this with all of you with Absar from ShopHTML, (who’s btw very responsive through email and IM, something we always appreciate in an outsourcing partner). Rather than doing some affiliate scheme we decided we’d make it fun for everyone: we’re going to be giving away a free PSD design to WordPress theme conversion (and I get one too myself, it’s good to be me sometimes). All you have to do is come up with a suggestion for a post you want me to do, here on Yoast.com, and leave a comment below on what the post should be on, and why you’d want me to talk about that topic specifically.
Next week, wednesday May 26th, at noon CET this competition closes, and I’ll pick a winner! The winner will not only get his or her free PSD design to WordPress conversion, but also the post they asked for, so, let’s hear those great ideas!
Outsource slicing & coding of your WordPress themes is a post from Joost de Valk‘s Yoast – Tweaking Websites.A good WordPress blog needs good hosting, you don’t want your blog to be slow, or, even worse, down, do you? Check out my thoughts on WordPress hosting!
WordPress Podcast: Small Business Fundamentals
Lorna Li is the Marketing Manager of Salesforce.com, the leading Customer Relationship Management (CRM) tool. Discussed on the show were several topics helpful for small businesses (SMB) getting started with a web site, including: selecting a domain name, keyword research / discovery, site structure, how to get the right site design, choose the right web host, find consultants and even selecting the best plugins to save you time.
Plugin Picks of the Week:
Bonus: next to working at Salesforce CRM, you can also hire Lorna as a Green Marketing Consultant through her blog, which is packed with good info on marketing, which is still awesomely useful even if you’re not that green. She has a good presentation on bootstrap marketing too that is worth checking out.
Small Business Fundamentals is an episode of The WordPress Podcast, which is a weekly podcast hosted by Joost de Valk and Frederick Townes.