Closed betagoo closed 1 year ago
Hey @betagoo !
I'd like to run some tests to try to replicate this issue. Could you please confirm if the text that changes is only the number?
Also, sharing the code you've run that found 73 entries and the database would be very helpful :)
I think, the search-replace command do not work properly.
Post content code contains:
some text <a href="[page_url 363]" class="btn">anchor text</a> some text
This wp-cli command found only 14 posts:
search-replace '<a\s+href="\[page_url\s+363\]"([^>]+)>([^<]+)<\/a>' 'ReplaceText' wp_posts --regex --allow-root --regex-flags='i' --regex-delimiter='/' --log --dry-run
Should find 73 posts.
If I make get_posts and execute preg_replace function on post content, the php script found every occurences into 73 posts (there is one occurence in one post).
Pattern, delimiters and flags are the same.