How to change any WordPress blog inner content link href by PHP code

WordPress Blog Inner Content Href Link change or update with PHP.

Firstly, go to includes directory in the WordPress theme folder below path


in includes folder find


Find $content_output PHP variable code around after 208 line of code you find

$content_output  =  '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
$content_output .=  $content;
$content_output .=  '</div>';

After that line, put PHP str_replace code. Below is our replace href link code

$content_output = str_replace('','', $content_output);

$content_output = str_replace('','', $content_output);

$content_output = str_replace('','', $content_output);

$content_output = str_replace('','', $content_output);

You can use any where str replace but I used after used $content_output code.

and check hover on a link href will change with replace text.


PHP str replace replace all or some characters with some other character in PHP string and this php function is binary-safe. Case sensitivities apply to this function. To replace something without regard to case.



ref link :