SimplePie::set_raw_data()publicWP 1.0

Set the raw XML data to parse

Allows you to use a string of RSS/Atom data instead of a remote feed.

If you have a feed available as a string in PHP, you can tell SimplePie to parse that data string instead of a remote feed. Any set feed URL takes precedence.

Method of the class: SimplePie{}

No Hooks.


null. Nothing (null).


$SimplePie = new SimplePie();
$SimplePie->set_raw_data( $data );
$data(string) (required)
RSS or Atom data as a string.


  • See: set_feed_url()


Since 1.0 Introduced.
Since 1.0 Beta 3

SimplePie::set_raw_data() code WP 6.5.3

public function set_raw_data($data)
	$this->raw_data = $data;