Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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