smashedpumpkins
Regular Member
- Mar 3, 2010
- 231
- 85
I'm looking for a plugin that will remove all links from my posts. I'm using WP-Robot to grab articles, but with the articles comes many affiliate links. I'd rather strip out all links and leave it as text only. (I don't want to mess up the formatting though)
Is there a plugin that can do this for me?
Thanks
EDIT: This may actually make it easier. I think... What would I add here to strip the links? Is it something simple? This is the section where it leaves all formating as it's seen. If I can change it to strip the links that'd be great. Sadly, I just don't know enough.
Is there a plugin that can do this for me?
Thanks
EDIT: This may actually make it easier. I think... What would I add here to strip the links? Is it something simple? This is the section where it leaves all formating as it's seen. If I can change it to strip the links that'd be great. Sadly, I just don't know enough.
Code:
$xpath = new DOMXPath($dom);
$paras = $xpath->query("//div[@id='KonaBody']//p");
for ($i = 0; $i < $paras->length; $i++ ) { //$paras->length
$para = $paras->item($i);
$paragraph = $para->textContent;
if ($paragraph != '') {
if (function_exists('ma_translate') && get_option('ma_trans_article') == 1) {$paragraph = ma_translate($paragraph);}
$content .= $paragraph . ' ';
$content .= "<br/><br/>";
}
}
Last edited: