[fr] Des retours à la ligne excédentaires se sont glissés dans mes anciens posts à un moment donné, cassant des liens et le formattage en général. J'ai utilisé un petit script pour supprimer tous les retours à la ligne de ces posts.
I only realised right now how badly broken about 500 of my old posts where. Somewhere in the process, newlines got added at the end of each line, and not just at the end of each paragraph. As WordPress kindly and intelligently adds the necessary HTML markup for paragraph and line breaks in posts, this meant that lots of my posts had broken links (when the newline occurred in the middle of a link) and uneven lines.
Victims: about 500 posts.
Solution: luckily, all the concerned posts had complete HTML formatting in them. Purely and simply removing all the newlines with a short PHP script was the way to go.
Thanks to all those who helped. You probably won’t be able to use the script as is, but if you have a similar problem at some point, it might help. The script pulls out the posts from the WordPress database, removes the newlines, and puts the post back into the table.
- Converting MySQL Database Contents to UTF-8 [en] (2004)
- Mystery WordPress/Markdown Problem: Troubleshooting [en] (2007)
- Requirements for a WordPress Installer Script [en] (2004)
- WordPress wp-login.php Problem [en] (2004)
- Scripts for a WordPress Weblog Farm [en] (2004)
- Plans for Basic Bilingual [en] (2010)
- Disqus Plugin Aftermath: Removing Duplicate Comments [en] (2009)
- Batch Category Editing For WordPress [en] (2004)
- Easier TopicExchange Trackbacks for WordPress [en] (2004)
- Invalid argument supplied for foreach() in wp-capabilities.php: Case Cracked! [en] (2007)