{"id":1880,"date":"2021-05-28T01:12:04","date_gmt":"2021-05-27T19:42:04","guid":{"rendered":"https:\/\/imageattributespro.com\/?p=1880"},"modified":"2023-04-25T10:09:02","modified_gmt":"2023-04-25T04:39:02","slug":"custom-filter-and-regex-filter","status":"publish","type":"post","link":"https:\/\/imageattributespro.com\/custom-filter-and-regex-filter\/","title":{"rendered":"Filter Custom Characters With Custom Filter And Regex Filter"},"content":{"rendered":"
Image Attributes Pro already comes with a range of common special characters that you can remove from the image filename to generate image attributes like alt text and image title. <\/p>
Here is a screenshot of the available Right below the available filters you have the The custom filter can be used to filter out any characters or words. Words or characters can be comma separated and are case sensitive. <\/p> Advanced users can use the regular expression (regex) part of the custom filter to filter out patterns from the image filename before it’s used as an image attribute. <\/p> Let’s say you are a photographer and all your images are named in this format: An example of that would be: You want to generate the image attribute as: Here are the settings to select in the This is what the settings will look like: <\/strong><\/p> You can see the end result below:<\/strong><\/p> Another common format for images is to have the dimension attached to the filename. For example, To remove the dimension alone (i.e. Filter Settings<\/code> Image Attributes Pro: <\/p>
<\/figure>
Custom Filter<\/code> and in this doc we will see how to use them to generate the attributes that we want. <\/p>
Custom Filter And Regex Filter<\/h2>
Example Usage 1<\/h2>
businessname-words-to-desribe-the-image-sequencenumber-ratio-dimensions-quality.jpg<\/code><\/p>
abcphotography-lion-walking-towards-sunset-01-16x9-2880x1620px-10pct.jpg<\/code><\/p>
Lion Walking Towards Sunset<\/code><\/p>
Bulk Updater Settings<\/code> tab.<\/p>
Remove hyphens ( - ) from filename<\/code> in
Filter Settings<\/code><\/li>\n\n
regex filter<\/code>. <\/li>\n\n
\/(\\d+x)|(\\d+px)|(\\d+pct)|(\\d+)\/<\/code> to the
regex filter<\/code>. (I tested it with the help of regex101.com<\/a>)<\/li>\n\n
Capitalization Settings<\/code> as you see fit. <\/li><\/ul>
<\/figure>
<\/figure>
Example Usage 2<\/h2>
microsoft-xbox-768x430.jpg<\/code><\/p>
768x430<\/code> in our example), use this in the regex filter:
\/(\\d+x)|(\\d+)\/<\/code>. Here is the same in regex101.com<\/a>.<\/p>