0

We are using relative image URLs in the post's HTML code. Looks like relative src links break on many RSS readers.

By default, Wordpress does not seem to prepare post's HTML for feed too much. Does there exist any solution for post-processing the feed URL and encoring all links and src attributes to be absolute?

0

Relative URLs are considered bad practice in WP, because of such issues and that they can be much more complex to migrate.

Basic approach to fixing this (not counting changing to absolute URLs everywhere) would be to filter the_content, while checking for is_feed(), and adjust links on the fly.

| improve this answer | |
  • In the case of absolute URLs how are you going to migrate? You need to rewrite absolute URLs in every post? – Mikko Ohtamaa Sep 8 '11 at 18:09
  • @Mikko Ohtamaa yes. And this is technically easier than to detect and rewrite relative URLs when go up/down a level or something like that. – Rarst Sep 8 '11 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.