WordPress 3.3.1 breaks my permalinks (7 posts)

  1. colinwiseman
    Posted 3 years ago #

    We recently tried to upgrade to 3.3.1 but this caused many of our posts to break. This is because of the following link:

    $title = preg_replace('|-+|', '-', $title);

    (formatting.php line 892)

    so this URL

    would be changed into


    and this won't be found as the URL "in-defense-of-yoga-pants-yogis-of-the-west-karen-macklin" doesn't exist in the database.

    Is there a way to turn this stop function sanitize_title_with_dashes from getting run? without me having to hack the code of WordPress - otherwise this issue will appear again when we next get an update.



  2. Tara
    Volunteer Moderator
    Posted 3 years ago #

    have you tried:

    -deactivating ALL plugins temporarily to narrow down the problem. If the problem goes away, activate them individually (one-by-one) to find the problematic plugin.

    If you don't have access to your admin area, try deactivating plugins manually via FTP or phpMyAdmin.

    -switching to the unedited default theme (that came with your version of WP) for a moment by renaming your current theme's folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue.

    If you don't have access to your admin area, then access your server via FTP or SFTP or whatever file management application your host provides.

  3. colinwiseman
    Posted 3 years ago #

    Hey t-p,

    It's not my plugins but the core code of WordPress that is breaking my permalinks. By commenting out that line referenced above the site works fine. I just don't want to comment it out.

    Unless do you think it could be a plugin calling the code by accident?


  4. Tara
    Volunteer Moderator
    Posted 3 years ago #

    try it to find out.

    -If the above steps do not resolve the issue, download WordPress again and replace your copies of everything EXCEPT the wp-config.php file and the /wp-content/ directory with fresh copies. This should replace your core files without changing your content and settings in wp-config.php file and the /wp-content/ directory.


  5. colinwiseman
    Posted 3 years ago #

    Thanks, but this is a fresh copy of WordPress that am using on my dev machine that breaks my permalinks.

    I had to sit and add an echo "here" at so many points to track down the line of code that changed urls from "a---b" to "a-b". Removing all plugins now.

  6. colinwiseman
    Posted 3 years ago #

    Ps I am on windows using iis7.0 but everything has been working amazingly until this latest version.

  7. colinwiseman
    Posted 3 years ago #

    Definitely not the plugins causing the issue. So yeah that line of code in the /wp-includes/formatting.php is causing all my URLs with multiple dashes to break.

    Gonna have to remove it and remember to remove each upgrade I suppose.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.