Support » Plugin: Search Regex » Change Permalinks: Post content regular expression

  • Resolved Robert


    Thought I’d share this solution for updating links in posts after changing the permalink structure. I search the web for hours looking for the correct regular expression and figured it out by using the Yoast .htaccess redirect rule.

    I changed my permalink structure from “Day and name” to just “Post name” in WordPress and setup the .htaccess 301 redirect described by Yoast.

    That left nearly 1000 post content links across hundreds of posts that referenced the old “Day and name” URL format, e.g.

    The following Search Regex regular expression updated the post content URLs to the new “Post name” permalink structure:

    Search pattern:

    Replace pattern:

    Include the www if your primary domain is

    The post link search and replace worked perfectly and saved countless hours of work!

  • The topic ‘Change Permalinks: Post content regular expression’ is closed to new replies.