johngodley / search-regex

Search Regex adds a powerful set of search and replace functions to WordPress that go beyond the standard searching capabilities, with full regex support.
https://searchregex.com
GNU General Public License v3.0
32 stars 8 forks source link

How to exclude Images? #174

Closed frmenu closed 3 months ago

frmenu commented 10 months ago

I want to replace year from 2023 to 2024 in my titles, metas, content and Article schemas of 700 posts with just one click.

But the problem I face is that 2023 is also present in Image URLS, image

which after changed will break thee images on my site.

is there any way or which filter I should use and how that only searched 2023 from titles, metas, content and Article schemas only and do not include images or URLs because image URLs are URLs as well. I also applied sluyg fil;ter and excluded media but it still searched the image URLS.

Need your help.

johngodley commented 10 months ago

You can use a regular expression that matches 2023 only when not surrounded by a slash.