Search engine optimization is one of the most popular subjects when nerds sit around and talk about Flash. “Does Google index your swf files?” seems to be the most popular question, usually garnering plenty of ‘yes‘ and ‘no’ and ‘maybe’ answers. The real answer to this question, once and for all, is this:
It doesn’t matter.
To understand this answer, you need to understand what Flash is. And to do that, you need to understand modern web development philosophy. First off, you need to embrace web standards. Semantic markup and separating content from style and behavior is the only way you should be building your sites. Many web standardistas have been recommending this method of web development for years, and rightly so. However, this post isn’t the place to go into the whys of this type of development, so I’ll skip that part and just say this about how it’s done: There are three areas of front-end web development: Content, Style, and Behavior. You should always keep these three things separated as much as possible.
That brings up the question: “Where does Flash fit into this three pillar method of web development?” Is it content? Is it behavior? Is it style? While it could be considered all three, most professional Flash developers will remove the content from their Flash movies and load it in using Flash remoting or XML files. That leaves us with style and behavior.
Style is added using CSS. Generally when you add images to your HTML that are purely presentational (no text or required content in them) you should add them in using CSS. In most cases you don’t want Google to index them because people don’t search the web for ‘top left rounded corner gif.” They search for content. Even if Google upgrades their crawler someday to read CSS files and index the images, they probably wouldn’t use the information for more than statistical analysis because of this.
Behavior is generally added using Javascript. Maybe you want a new window to open set to a certain size, or you want to use some fancy Ajax to let users rate something without refreshing the page. This should all be added unobtrusively, and if the browser doesn’t support Javascript, it will hopefully still work. Unfortunately, not everyone considers this, and these days Javascript is becoming more and more of a requirement to use most websites. So you should always provide some sort of alternative for non-Javascript users. When it comes to indexing behavior, Google will for the most part not index your Javascript files. Even if it did, most web users would have no idea what the .js file they are looking at actually does. When using Javascript to change your document, Google will not read the ‘final’ page, but only the raw HTML file. Google does not render Javascript 1.
Now that you know all of this, it’s time to look at how to treat your Flash content. Since we’ve determined we don’t want Google to index our swf files, but we do want it to index the content displayed inside them, what is the best way to go about this?
As stated before, if you are building Flash sites professionally, you probably move all your content out of your Flash movie and into an XML file or keep it in a database. This makes it much easier to allow Google to index this content by using progressive enhancement.
Progressive enhancement is a method of web development that goes hand in hand with Web Standards. You start with your HTML (your content), then add CSS (your look and feel), then add in additional behavior (Javascript, Ajax, Flash, any other interactivity that isn’t handled automatically by the browser).
The best way to add Flash progressively is by using Javascript, or more specifically, a script like FlashObject. First you lay out your page as if you aren’t using Flash. If you are using a database for your content, you can spit out that data as HTML where the Flash movie will go on the page (or maybe just a preview of the content, it’s up to you to show Google the content you would like indexed). Then you use FlashObject to replace this content only if the user has Javascript enabled and the required Flash plugin version.
Here’s a small example of what that might look like:
<div id="flashcontent">
This is replaced by the Flash content if the user has the correct version of the Flash plugin installed.
Place your HTML content in here and Google will index it just as it would normal HTML content (because it is HTML content!)
Use HTML, embed images, anything you would normally place on an HTML page is fine.
</div>
<script type="text/javascript">
// <![CDATA[
var fo = new FlashObject("flashmovie.swf", "flashmovie", "300", "300", "8", "#FF6600");
fo.write("flashcontent");
// ]]>
</script>
This causes Google to skip the Flash swf files and only index the HTML (the content!) you place on the page. You can place links to other pages, images, whatever you want Google to index, and when a viewer with a browser that supports Flash visits your site, they will then see the Flash content. This gives you full control and much greater predictability over what content Google will index. And if your content is pulled from a database that is editor controlled, your pages will update and be re-indexed as the content changes without the need to re-publish all your swf files.
1 Currently Google does not render the Javascript on a page, but there are rumors that they are developing a new crawler based on Firefox (they employ a number of Mozilla foundation members) that will index pages based on how the browser sees them, instead of the raw HTML content. This means HTML hidden by CSS may not be indexed, and pages that are altered by Javascript after they load will be indexed how they appear to the user. However, this is all rumors and until it happens Google will ignore your Javascript content.
Note: In this article I use the ‘Google’ name often, but it can be interchanged with any search engine, as they all work roughly the same way.
The recommendation is to display the same content that is in the XML files as HTML ‘under’ you Flash movie.
Google recommends that you create a separate HTML ‘crawlable’ site that they can index – this is basically that same technique, but the HTML + Flash live together on the same page.
That proceedure is very close to the techniques used to ’spike’ pages with text just for Search Engines and for nothign else.
This method absolutely works. I used Flashobject for displaying flash at my old company. Google did not have any issues with indexing the site and giving us the top rank.
Flashobject is not only lightweight flash detection, it validates!
The problem with this method is that it is, in both concept and actuality, cloaking. The search engine sees something different from what the user sees. Regardless of whether or not you are using this in a non-malicious fashion, it risks the long-term viability of the site by using javascript to show the user something different from the content itself.
Furthermore, there is a legitimate limitation in that it requires that an individual create essentially 2 websites. A flash site and an alternative HTML site (albeit on the same page). The extra work is simply not worth it.
Well, the cloaking issue will obviously depend on how you code the site in question, but assuming you do it right, the search engine will see the exact same content that the user sees in the Flash movie, it’s just in a different format. (I’ve already addressed this issue further up the page)
As for whether or not it’s ‘worth it’, that will always depend on the site in question. While I’m not a big fan of putting a lot of content into a Flash site, you have to admit that Flash offers you a lot more options when it comes to interactions over plain HTML, so *if* you end up using it, whether or not it’s ‘worth it’ to create a searchable alternative is up to you.
The incremental of flash-sites is the totaly false wrong way.
How can you consider this cloaking when you are showing viewers without Flash and/or Javascript the same thing as the search engines?!? You are not blasting keywords (though some people will and Google may pick up on it), you are simply giving non-flash viewers, non-js viewers and search engines a way to enjoy/index your content.
Grrrr, lots of confusion, Will anybody show me a live example.
A live example: http://www.2advanced.com. If you view the source you will see they use the exact technique discussed here.
Great article (and conversation)! Joe’s (2Advanced) sample was great, but merely shows the (“You don’t have Flash…”) replaced text. Does someone have an example where we could see a more complete page content replacement?
Posts are nice and helpfull too.
It is very useful for all develper and web designer flash object is very easy to add website most user like that javascript with flashobject.
Great post. Too many people either don’t bother to expose their flash content to search engines, or just put the task into the ‘too hard’ basket.
Most of the content in my Flash movies is loaded from XML files, which I expose to search engines (parse and write to screen as HTML via PHP), but not to regular visitors. Yes, this requires user agent sniffing, which I know isn’t super popular, but I don’t see any danger in sniffing googlebot, msnbot, yahoo slurp, which all clearly identify themselves in their UA string.
Even just exposing a sites news feed XML works very well, as the newsfeed changes regularly, so the site content always looks fresh to the search engines.
But whichever way it’s done, I’m all in favor of Flash developers making the effort to make their sites search engine friendly.
One point that I still have not cometo have a full understanding of. Google doesn’t like javascript, correct? Then why does Adsense use Javascript? Is there something else that lies beneath this that I am missing here?
So which is the easiest way to embed the xml as alternate content? Could I use <xml src=”file.xml”></xml>?
It’s a great article, although there are pleanty of for and againsts on this topic.
I refer to it here in aFlash SEO post after stumbelling across your’s while writing it! I think using JS is certianly a less effective method.
You’re correct in saying get your data our of flash in into XML – agree.
But using the JS to progressivly display is isnt the best option.
DerekA posted the perfect response. :)
But at the end of the day, it’s still probably a 50/50 call – but as corporates poor money into design and flash – the search engines will notice and more forward with recgonition.
None the less – Fantastic post.
Incase the article has been pushed down the page – here is it’s direct link.
I posted a responses to Derek when he posed that, and I think much if not all of my response still stands today. Not using Javascript has too many drawbacks.
Fair enough – I think it’s just one of those touchy subjects that is still yet to be proven one way or another. Especially while both ways are currently working. Although as a general rule, the less javascript the better I thought.
I still think intergration with javascript to help google get the flash content is an extra effort that can be avoided. When flash or xml can auto publish so much of it into the div id=”flashcontent” it’s just wasted time that can be better spent enhansing the site interaction or better yet – improving profitability.
Well the whole idea is that if you can, you should provide alternate fallback content. So even if they don’t have Javascript enabled they can still read and interact with your content. Don’t think of the alternate content as just something for search engines. Think of it the same way you think of using unobtrusive Javascript: you build the HTML first and get that working, then enhance it with Javascript (and in this case Flash).
Obviously this won’t work for every project, but if you can do it you should.
Very nice workaround indeed but in my opinion there is a slight setback.
Very often we have a situation in which we can not parse the content of the particular page down to the HTML stack cos the remoting is triggered from within the Flash and it does not redirect or change the location of the browser. Even if we use some external navigation system that is synced with Flash we still need to get the content for HTML first and then secondly from within the Flash for Flash interpretation. For Flash remoting that doubles the queries and even tho we can use some inner caching it still affects performance in quite a way.
I am not a programmer and have only basic html knowledge. I consider myself a graphic designer more than a script writer and therein lies the problem.
And so- I barely can understand what you guys are talking about…
I need your help… :)
I love Flash and would love to do everything in flash because its easier than html and tables (piss me off each time).
I’ve designed a webstore (www.thezima.com) and the same store on ebay (http://stores.ebay.com/thezima) partially using flash in the header.
I hate the click to activate new IE feature because it scares off potential customers.
Another issue is that ebay does not allow javascript on listing pages, and as I’ve read SWFObject is using javascript (know nothing about it).
I would like to be able to create web stores and web pages using flash exclusively, and I need to know how to create the alternate content to index well the pages for google.
And I need to get rid of the click to activate thing.
Is anyone willing to help out? I will be very grateful.
Email me please at i@designasquare.com
Hey everyone.
This stuff is interesting – I don’t know much about SEO but I’ve got a question. Inserting some content in the div which gets replaced with your swf is a good method, but what if you have a large site with a lot of content you want to get indexed, all contained in the swf file? How would you go about doing it? Would you insert a whole heap of content into the single div tag, containing everything you want indexed?
Advice would be much appreciated!
Here’s a new thought that most of you hardcore developers don’t seem to get. The only way we get and got to where we are today on the web is by hacking and bending some of these “guidelines” till it became acceptable practice and finally made it into W3. Has W3 stayed unchanged during the past 3 years, NO. If game developers had to take the same approach as most of you esteemed web developers we would still be running games from 5inch floppy disks on 640k memory on 4 color monitors simply cause they didn’t want users to upgrade to sound-cards. I agree its important to heed, but hell these conversations are so 2001. The audience needs to evolve if the industry is to grow, we as developers just have to realize and accept that we also need to acquire some new languages and skills and maybe we’re not as perfect with what we know as we would like to think, a person who stops learning might as well be dead, but please don’t take the web to the grave with you.
Most of the developers I talk to don’t have the client’s interest at heart, but rather their own inherit laziness to learn new things. I cant believe it but it seems there are STILL developers out there who thinks layers should not be touched! I mean how narrow minded is that?
Beside the fuss, its a very nice article and just more reason why we CAN use flash to design websites that make money.
Great article Geoff – just implemented it and tested it – works great. Now we’ll see what the engines do. This type of thing is a great compromise in that many clients really are drawn to the richness of flash and often have brand aesthtics that they just can’t reach with HTML alone. However, since they also demand the most from e-commerce, there is a great need for maximizing search engine exposure. This method allow for both so kudos to you. Fine work!
simple solutions are tasty morsels :)
thanks
For some reason I can not get your sample to work.
I noticed that some of the quotes dont copy/paste right, but even after fixing those the flash file never shows.
I tested the suggestion made by Derek A, and it works fine for me. Is there something I may be missing about your suggestion, or any major differences between the two I could be missing?
How do you go about optimizing your site if it’s a flash website? Any articles I might be able to read or books? Thanks
I have a stupid question: If I use an XML file external to the html embedding the SWF to contain the content, wouldn’t the search engines capture the XML file, therefore taking the user to the XML file rather than the html site file?
I suspect that’s thereason general public want to read blog….Internet visitors generally create blogs to declare themselves or their secret views. Blog grant them same matter on the monitor screen what they specifically needed,so as the above stuffs declared it.
I’ve got the same question as paul del signore.
Tnx in advance.
I wanted to know that if any body is having only flash pages then how to get rank in google becuase google only consider contents.
Hi Anil. Maybe in the future google will include this feature.
Thanks so much for the great article. This is an interesting discussion that has somewhat demystified Flash SEO for us. One great way I found to test this out is by downloading the Firefox extension named ‘Web Developer’. You can quickly disable javascript and refresh the page to see the non-flash content. Then it has a great feature to edit the css on the page in ‘realtime’ too. Here’s our site if you want to see a page that has non-flash content other than a simple “go get your flash player updated” message. We just updated our site so it might take us a while to see the results on google, but so far we’ve had great feedback and are now featured on a few sites like this one http://feed.stashmedia.tv/feed/2007/3/8/coreaudiovisual-update.html
Here’s our site:
http://www.coreaudiovisual.com
Thanks you all again!
Eric Bowman
Hi,
I tried to apply the “SWFObject” method to embbed a flash object in a html. I have a full flash webpage and I’ve found interesting to implement this method. The problem is that SWFObject isn’t work for me. I’ve folloved all the steps and when I tested I’ve got the replacing text in my browser instead the flash content. I have the required flash player installed and javascript enabled. Why should I do? Can someone help me? Pls.
Hey everyone.
This stuff is interesting – I don’t know much about SEO but I’ve got a question. Inserting some content in the div which gets replaced with your swf is a good method, but what if you have a large site with a lot of content you want to get indexed, all contained in the swf file? How would you go about doing it? Would you insert a whole heap of content into the single div tag, containing everything you want indexed?
Advice would be much appreciated!
Here’s our site if you want to see a page that has non-flash content other than a simple “go get your flash player updated†message. We just updated our site so it might take us a while to see the results on google, but so far we’ve had great feedback and are now featured on a few sites like this one
Hi Anil. Maybe in the future google will include this feature. But i Have problems to inlcude it.
BTW, GOOGLE now indexes CSS. And its not for statistical reasons, its for ‘dirty deeds done dirt cheap’. They check the CSS for hidden areas of text to trick the engines.
Interesting, but can you prove it?
Hi! Great article, it answered every question that I had rattling around my head. I’m primarily a flash designer and I’ve been using and preaching about the benefits of SWFobject since I first heard about it at the end of last year. However recently I’ve been redeveloping my own website and so all of the SEO issues started to spring to mind – will it spider, won’t it spider, will clients find me etc etc.
On the surface of things it has always been obvious to me that the alternative content you can provide when using SWFobject will be picked up by search engines, but the issues I was primarily interested in was a) would it be considered “Cheating” by the Search Engines and therefore cause my site more problems, and b) would it spider as effectively as a “normal” CSS site. Your article has answered those questions effectively as far as I’m concerned. Thankyou!
Regarding javascript embedding and those amongst us who are against it – perhaps you would like to provide a more suitable alternative that could get around the annoying IE ActiveX problem? To me this situation is black and white, do I a) alienate people who have turned javascript off (a minority) or do I b) alienate everyone using internet explorer. The choice is quite simple. Obviously in an ideal world you wouldn’t alienate anybody, but with the imperfections of the technology and with companies such as microsoft causing problems with the flash plugin, we currently have no alternative but to choose.
Finally, as much as I am impressed that a company as reputable as 2Advanced are using SWFobject, I believe that their alternative content is not a good example of SEO…its obvious to me that their reputation is now so big that they no longer have to worry about such things (wouldn’t that be nice!?). Great to see that they’ve adopted the methodology though.
Thanks again for a great article.
Macromedia has a Flash Search Engine SDK that will give us just what we need :)
I thank you for your comment.
This seems excellent in theory and we’re considering going down this path with Flex. Does anyone have confirmed success with this approach from a SEO perspective.
This site, http://www.coreaudiovisual.com, was mentioned, but I didn’t have any luck getting search results on deep content. Does anyone have example implementations, as I need a little more proof for my bosses :)
In a related blog topic, http://www.ericwebster.net/2006/02/content_injection_in_flash_wit.php, where Geoff commented around using SWFObject, they note http://www.pontiac.com as an example and I had very good luck searching for products (cars) and getting results back into the specific car type in the site. And they have a non-flash version toggle at the bottom of the site.
Other Flash sites that are often sited like http://www.harleydavidson.com and http://www.pillardata.com don’t have very good search results back into their product section pages either (however, I’m not sure they were even trying to solve for SEO, so no knock to them, I’m just trying to find some positive examples).
And thanks again for a great article!
Hello all,,, I think this is a great solution!
I have just finished my implementation: http://www.kichaka.co.za
It is completely unranked at the mo, will hopefully post back in a month or so with an update
Thanks
A quite intresting idea is realized in this website!
thanks for that interesting blog !
I think, a really interesting topic. But I m searching about WEB 2.0 cause of thinking there is the future.
nice article.
” The real answer to this question, once and for all, is this: It doesn’t matter.”
Thanks that there are some people out who try to tell people the truth. it really doesn´t matter.
The problem is that too many people call themsel seo´s and so there are many nerds sitting and talking bullshit.
just a littel tip, try to reduce the spam inhere a littel bit. there are nice plugins out.
“A live example: http://www.2advanced.com. If you view the source you will see they use the exact technique discussed here. ” Perfect, thanks!