In my daytime job I’m a Flash developer. But when it comes to creating websites I don’t think Flash is the way to go. Not just because Flash has some serious accessibility issues, but mainly because Flash-only websites are very search engine unfriendly. They usually consist of only one HTML page, and most of those contain no readable content. So Google, MSN and Yahoo will have no clue as to what your site’s about. I’ve been pondering things you could do to fix or at least improve this. I’ve played around with a few of these ideas and techniques, others are still on my to-try list. Please let me know if you’ve come up with other solutions or have anything else to add.

1. Use SWFObject.

Geoff Stearns’ SWFObject is the way of embedding Flash movies into HTML pages. It’s only drawback is that it uses Javascript, but in return you get the best plugin detection that (no) money can buy, a fix for the Internet Explorer activation issue and the ability to add HTML content in a placeholder div for search engines and people with no Flash player installed. Put a short summary of what your site about (make sure you use plenty of keywords), along with contact details in there. That way, Google will a least find something it can read.

2. Accomodate deeplinking

Through a bit of PHP(*) and actionscript you can make sure anyone calling up www.yoursite.com/index.php?page=contact is taken to the contact ‘page’ in your flash movie. For a simple timeline-based Flash website the actionscript needed can be as simple as:

if( page != undefined ){ gotoAndStop(page); }

If your movie has a key frame labelled ‘contact’, it will be shown.

For this to work you need to use PHP to tranfer the ‘page’ url variable into a flashvar. With SWFObject, the javascript code needed in the page will look something like this:

Besides the obvious advantage of being able to send someone a link to a specific page, this also allows you to use a Google sitemap. Make sure you include a ‘menu’ listing of these links in the placeholder content so search engine bots can follow them.

A variation to this approach might be to create copies of your index.html with descriptive name like ‘about.html’. These can have different placeholder content but load the same Flash movie. No need for PHP, just add the right flashvar to have the movie skip to the right page. Obviously, this approach is best suited for small websites with only a limited number of pages.

* = Or any other server side programming language. Javascript probably has a few tricks up it’s sleeve as well.

3. Google sitemaps

A Google sitemap is an XML document that you place in your site’s root folder that contains the layout of your site. Google’s indexing mechanism will use this info to index every page on your site. You can simply put the “?page=something” links in there, and each page will be indexed. Especially for large websites, this could be an ideal way to make sure all your pages are spidered. Without having to link to every single one from the placeholder HTML.

4. Dynamic placeholder content

With the tweaks covered so far, each ‘page’ of your website will still have the same placeholder content. Whatever you chose to put in the SWFObject placeholder div. The trick now seems to be to generate a page with placeholder content that matches the content of the page the Flash movie will (initially) display. If you’re using something like “?page=about” in your URL, your movie will load(*) and display the about page. From then on, the user can navigate the site, but the placeholder text won’t change. This is not a problem, as search engine bots will not do this and the sitemap will ensure all of the URLs are called. So all we need to do now is create a script that inserts the “about” page content formatted as HTML into the page’s placeholder div.

If you’re using a CMS type solution, this might turn out to be quite easy. Instead of just generating XML for Flash to read, output that same content as simple <p>’s and <ul>’s and insert that into the page. For static websites this can be a bit of work, as all content needs to be maintained in the movie (or the XML files it loads) and in the PHP code. But if you’re serious about ranking well in search engines, it’s probably well worth the effort.

I’m not sure if Google will like this, any type of dynamic placeholder content might be considered ‘cloaking‘. Your best bet is probably to have the Flash content and the placeholder content match exactly.

* = Most Flash websites I’ve worked load XML data either from disk or through something like SOAP or Flash Remoting on a per-page basis.

5. Adding internal links to the placeholder content

Google sitemaps are great, but unless you create a script to do this for you, updating them can be a lot of work. A more practical solution could be to convert the internal links used in your Flash project into HTML. I’ve built numerous Flash projects that use a single XML document to describe each page. A link from one page to another might look something like:

<next>page2.xml</next>

This tells my Flash movie to load page2.xml when the next button is clicked. If your project uses a similar setup, it shouldn’t be too hard to translate this into:

<a href="index.php?page=page2">next</a>

If you succeed in adding links from your XML source as regular HTML links, your site will be truly indexable. In fact, you’ve now created a working HTML version of your website inside SWFObject’s placeholder div.

6. To the extreme: HTML style page refreshes

Since we’re now using HTML content in the placeholder div, search engine spiders will follow the links in that content and truly spider your website. One further step you could take is to use the same links inside your Flash movie. So if you’re on the about page, and the user clicks on your ‘contact’ button, use actionscript’s getURL command to get index.php?page=contact.

This will cause an old-fashioned page refresh, but it will also update the address bar so people can bookmark all the pages in your site. The Flash movie itself will be cached by the browser, so page load times should be minimal. If you need to maintain user info from page to page, a local shared object is probably your best bet.

There’s also a way to update the address bar through javascript, but I wonder if that works on all browsers and whether it allows for bookmarking. If you can live with the page refreshes, this seems to be the best option.

Conclusion

I haven’t tested all of these approaches myself, and I’m definitely not an SEO expert. But I feel pretty confident that having dynamic placeholder texts that make your website indexable for search engine spiders, along with unique URLs for pages in your website will improve your site’s rankings dramatically. Like with AJAX it’s a question of prioritizing presentation and SEO for your website. Flash is unrivalled when it comes to creating visually exciting websites, but its troublesome to get Flash websites to be accessible and indexable. If you do decide you want to go with Flash, these tips might just help your audience find you.

I’ve actually downloaded the swf2html tool a while ago and I found the results to be very poor. Only static texts were extracted, and those are generally not used for important content. Most content is usually loaded in, and that’s where the tool fails miserably (or at least did when I tested it.

I’ve actually set up a little experiment on this site to get more conclusive results.

Really useful info so thanks for that. Making Flash SEO is a very important subject that the Flash world seems uneasy about. I don’t really understand that, as to me its a pretty basic requirement for a site these days, anyway onto my “question”

I want to create a Flash site that loads in all its copy from either a mysql database or XML files or .txt files (or a combination of any of these). What would be the best methods to make the dynamic content indexable? it seems that its possible to “dump” the content to the page so spiders can see it? or would I create php code that does this? (either dumping the .txt straight, or building XML files?). Or should I use SWFobject, and place the dynamic content on the page with that? and how would I do that? haha, I think you can tell i’m a tad confused about this!

Hi Bombanguk. Although I didn’t really test it, my personal approach would be to give the main pages for your site a unique url, make sure they’re in your sitemap and then make sure the correct content gets put into the placeholder div.

How to do this will vary from project to project, but you’ll probably need some PHP. I’m not quite sure what you mean by ‘dumping’, but I’de be interested to see what happens when you use PHP’s unclude function to add the content into the page.

Very interesting topic. I know I am late coming to the party but I just created a new site for a friend of mine because his ENTIRE site was in flash. He is a photographer and needs to have a nice looking site but the problem was he as not being ranked well. So I redesigned his site but I did add some flash to the header and his photo galleries. I am presume it’s ok to have some flash just as long as you have links and text that is indexable.

One thing I found very interesting when researching various photography websites were that almost 99% of them were flash. And they all rank very well! If you go and do a search for los angles photographers or just pick any city and search for photographers you’ll find that they all have flash. There is one website that I found that is 100% flash and is coming up for almost every key term! I can’t figure out what they are doing but what ever they are doing is working very well. The site name evokephoto.com – just do a search for houston photographers or houston wedding photographers. They are defiantly doing something behind the scenes with this one.

Roy: I uploaded my flash based website that is called via a .php file. I included meta tags in the php and the bing robot found it and listed me in number 5,however, google seems to not like the swf (flash file) and is not listing me or finding me. Somebody suggested to upload some “shadow” html in addition to my swf, but I am not sure how it is going to work, I will be experimenting and keeping you posted.

The point is that at least for Bing, meta tags are still running and very strong, I did not expect to be listed in number 5.

First I would like to say, I love the cumulus. I was wondering if you could place text to the side of the cloud, it seams it must be in a row by itself and I’ve tried several ways to edit this, but my text is still placed under the cloud. Is there a fix for this?

Hi M.D. Are you trying to change the widget or simply add it to a page? I’d recommend against modifying the code, but using basic HTML tricks link ‘floats’, you should be able to place text next to the cloud (or any element that’s not too wide for it to fit).

This is good stuff. So many of our customers want Flash sites these days, and at the same time they want them to be complete SE optimised. It’s great to see that there are more and more ways to actually make this happen. Thanks!

Welcome to roytanck.com

This is the personal blog of Roy Tanck, freelance WordPress consultant, designer, geek, and amateur photographer. It's also the home of projects like WP-Cumulus (a 3D tag cloud for WordPress). More about me here, or you can follow me on Twitter.