doubledee — 2011-12-31T12:57:47-05:00 — #1
What is a reasonable field size for a "Slug" (e.g. www.MySite.com/articles/[b]why-incorporating-your-business-makes-sense[/b])
Right now, I have a VARCHAR(100) chosen.
r937 — 2011-12-31T20:35:11-05:00 — #2
VARCHAR(255) is exactly the same as VARCHAR(100) except that it will hold a larger value
for some columns, where you anticipate a chance of needing to store a value larger than 255 characters, you might want to choose TEXT instead (this is handled differently internally than a VARCHAR)
but slug isn't one of them
doubledee — 2011-12-31T22:05:50-05:00 — #3
Except that a VARCHAR(255) allows up to 255 characters... gasp And I don't want slugs to be that long. (Would you?!)
I am thinking that if you can't say it in 100 characters then you need to re-think things. But that is just me?!
r937 — 2011-12-31T22:10:31-05:00 — #4
that sounds fine
make sure you add code to test the length of any proposed slug, and issue a user-friendly message instead of just storing the data into VARCHAR9100) because it'll get truncated and you might not notice
doubledee — 2011-12-31T22:29:12-05:00 — #5
Yep, I had the same idea earlier today.
Okay, sounds good.
This may sound like a funny question, but does Google have a limit on the length of what we are calling a "slug"?
By that, I mean does Google maybe ignore the part of the slug over a certain number of characters when indexing and what-not?!
So, if my slug was...
...but Google chopped things off after 25 character, the to Google, it would be...
(And, hey, who doesn't?!) :rofl: :angel5:
r937 — 2011-12-31T22:54:05-05:00 — #6
i don't think google knows what a slug is, so why would google truncate it?
doubledee — 2011-12-31T23:32:02-05:00 — #7
One of the key reasons for creating slugs is that Search Engines are supposed to like them.
I don't know how, but Google certainly uses the URL - especially the slug - to index things.
So, if Google had a limit of 25 characters, then it would index
instead of indexing...
And it might think my website or at least the web page in question about a topic entirely different than what it actually is about.
The logic is the same as what would happen if your Title or Description got chopped off.
If your Title read...
This is a really really awesome web page that is many focus on dealing with CSS Tips
...then you would get indexed the same as if you had a title of...
CSS Tips & Tricks
r937 — 2012-01-01T03:12:12-05:00 — #8
i understand that search engines know what urls are
i don't think they know what slugs are