In the style.css file in the first comment block, there is a optional "Tags:" directive. What are these tags used for? When are they used?
1 Answer
The theme tags are used to sort/categorize themes in the WordPress theme directory according to features or characteristics.
For example, if your theme supports two columns (a typical blog format), then you use the two-columns
tag and if it supports multiple screen sizes, use the responsive-layout
tag. This makes it easier for someone looking for a theme to be very specific - i.e. "I want a theme which has three columns, mainly dark colors, allows for big featured images and supports the Arabic language. And it should work on all devices including phones and tablets." This would translate to a tag list like this: three-columns, dark, featured-images, rtl-language-support, responsive-layout
.
These tags are only used on the WordPress theme site and are completely optional. However, it means that people using those search filters might not find your theme and that's no good. If you're making a custom theme for yourself or for a client and you're not going to upload it to the WordPress theme directory, you don't need to include them.
For a full list of tags you can use, check https://make.wordpress.org/themes/handbook/review/required/theme-tags/.
-
What if you decide to distribute your theme outside of the WordPress theme directory? Can I just remove this Tags line?– SamJan 27, 2011 at 22:28
-
Yes, you can. You are free to remove the Tags line from the style.css comments– keatchJan 27, 2011 at 22:34
-
3@Sam - FYI, except for
'Theme Name:'
everything in the theme header is optional. Jan 27, 2011 at 22:37 -
-
Small addition: Tags are also shown in admin area, when you open the theme details dialog. Valid tags will be translated to the user's language, invalid tags show up as plain text. Feb 28, 2020 at 12:08