iSEO.co.nz Home

Removing the #more from wordpress

May 12, 2010

Here is my guide on how to remove the #more tag in wordpress, the link at the bottom of an excerpt that takes you through to the anchor of your article, I prefer a clean link to the full article. You can add this code to your functions.php file and remove it, pretty simple.

function remove_more($link) {
$offset = strpos($link, '#more-');
if ($offset) {
$end = strpos($link, '"',$offset);
}
if ($end) {
$link = substr_replace($link, '', $offset, $end-$offset);
}
return $link;
}
add_filter('the_content_more_link', 'remove_more');

Leave a Comment