Skip to content

Instantly share code, notes, and snippets.

@doofusdavid
Created July 24, 2013 16:42
Show Gist options
  • Save doofusdavid/6072257 to your computer and use it in GitHub Desktop.
Save doofusdavid/6072257 to your computer and use it in GitHub Desktop.
quick and dirty wordpress slug generator in excel for data import from an existing database.
=LOWER(CLEAN(SUBSTITUTE(TRIM(C2)," ","-")))
@ChrisCinelli
Copy link

It obviously depend on your slug algorithm. However in google spreadsheet you can use

=LOWER(SUBSTITUTE(REGEXREPLACE(REGEXREPLACE(TRIM(C2),"[^a-zA-Z0-9\s]",""),"\s{2,}"," ")," ","-"))

In Excel you will have to implement REGEXREPLACE as a macro (it should not be too difficult)

@cpescott
Copy link

My gawd I need this - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment