Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Ryan Codes
Ryan Codes
14,888 Points

woocommerce shorten product slug

Hi,

ive been searching on how to trim or shorten the product slug in woocommerce. i have a lot of products being imported from aliexpress and dont want to go through every single one of the products and edit the slug manually. sample slug below:

product/twotwinstyle-summer-side-high-slit-long-t-shirt-women-sex-dress-short-sleeves-black-new-fashion-clothing-in-dresses-from-womens-clothing-accessories-on-aliexpress-

can anyone point me to the right direction on how to do this?

1 Answer

Well for starters, is that the product title? As well, depending on how the import is done, can you omit the slug from it? Woo/Wordpress by default does the product title, if that is the title then there are more problems than just the slug.