WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Your Answer


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.