How do I hide stuff in HTML?
May 8, 2005 7:42 AM   Subscribe

I want to have a long list of search terms on my page, but not display them.

Sorry if this is patently obvious, but I am only an egg.
posted by ackptui to Computers & Internet (10 answers total)
 
You mean <meta> tags?

To summarize, if you want to list a description and a bunch of search engine keywords for a page, you'd put something like :

<META name="description" content="AskMe answer to putting a description in a META tag">
<META name="keywords" content="meta, askme, tags">

Inside the <HEAD> section (between the opening and closing HEAD tags) at the top of your HTML document.
posted by onalark at 7:54 AM on May 8, 2005


(on preview -- ya beat me to it, onalark!)

Do you mean keywords that search engines will pick up on? Read up on the META tag -- 2 flavors of it are:

< meta name="keywords" content="word word word">

< meta name="description" content="description">

Both of these tags go in the < head> section.

Remove spaces after the "< and>"
posted by omnidrew at 7:55 AM on May 8, 2005


"correct meta tags won't help you in optimizing for Google, but misleading meta tags could cause your site to be banned."

As an alternative you could set the colour of the text you want to hide to the same colour as the background, and put it somewhere out of the way at the bottom of your page; but this will still show up to anyone that ignores or overrules the stylesheet or happens to highlight the text. Another option might be to have your stylesheet overlap certain objects, but that only gets round one of the issues above.

On a side note, I'd think very strongly about doing this -- leading people to a page that doesn't have the content they think it will isn't particularly user friendly, accessible and might potentially be annoying or infuriating.
posted by nthdegx at 10:25 AM on May 8, 2005


Of course, if you're not talking about meta tags and just want to hide content on a page, the way to do it is with comment tags: <!-- hidden text goes here -->
posted by katieinshoes at 10:43 AM on May 8, 2005


Google is pretty smart about ignoring any "hidden" keywords. There are many ways you can force the issue, but they've had years to adjust to tricks like setting the text the same color as the background, etc. Naturally they completely ignore meta tags and html comments.

I won't take up space in this thread to tell you it's unethical, but I will say that so many unethical people have done exactly this for so long that it's no longer very effective.
posted by scarabic at 10:54 AM on May 8, 2005


This isn't always unethical. For example, I have a very graphics oriented page, and I wanted my name and the subject available for search engines. One way is to use CSS and put in an H1 then define H1 as either the same color as the background, or as not displayed.
posted by cccorlew at 12:01 PM on May 8, 2005


This isn't always unethical. For example, I have a very graphics oriented page, and I wanted my name and the subject available for search engines. One way is to use CSS and put in an H1 then define H1 as either the same color as the background, or as not displayed.

Ethics is highly personal, but I would consider that an unethical SEO trick and, well, it's against Google's rules, so you can face the wrath of that decision later on sometime.

Of course, if you repeat the same terms that are in the H1 in the graphics as the main headings, then fine, but that's not what the original poster was asking for.
posted by wackybrit at 3:47 PM on May 8, 2005


Lots more information on Search Engine Watch.
posted by matildaben at 5:39 PM on May 8, 2005


I believe that Wordpress was in trouble recently for putting search terms inside a DIV and then positioning it way off screen.
posted by sbutler at 9:11 PM on May 8, 2005


If we're offering up resources, WebMasterWorld is one of the best. Tens of thousands of pages and discussions on every single issue related to SEO, marketing, making money on the Web, etc..
posted by wackybrit at 10:39 AM on May 9, 2005


« Older Configuring a Zoom X3 5660A router/modem for Bit...   |   range of an advertisement Newer »
This thread is closed to new comments.