{"id":1834,"date":"2024-01-24T15:18:27","date_gmt":"2024-01-24T09:48:27","guid":{"rendered":"https:\/\/myfreeonlinetools.com\/blog\/?p=1834"},"modified":"2024-01-24T15:21:51","modified_gmt":"2024-01-24T09:51:51","slug":"how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code","status":"publish","type":"post","link":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/","title":{"rendered":"How to change any WordPress blog inner content link href by PHP code"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>WordPress Blog Inner Content Href Link change or update with PHP.<\/p>\n\n\n\n<p>Firstly, go to includes directory in the WordPress theme folder below path<\/p>\n\n\n\n<p>..\/blog\/wp-content\/themes\/enfold\/includes<\/p>\n\n\n\n<p>in includes folder find<\/p>\n\n\n\n<p><strong>loop-index.php<\/strong><\/p>\n\n\n\n<p>Find $content_output PHP variable code around after 208 line of code you find<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$content_output  =  '&lt;div class=\"entry-content\" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';\r\n$content_output .=  $content;\r\n$content_output .=  '&lt;\/div>';<\/code><\/pre>\n\n\n\n<p><strong>After that line, put PHP str_replace code. Below is our replace href link code<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$content_output = str_replace('https:\/\/myfreeonlinetools.com\/blog\/','https:\/\/myfreeonlinetools.com\/', $content_output);\n\r\n$content_output = str_replace('https:\/\/myfreeonlinetools.com\/guide\/','https:\/\/myfreeonlinetools.com\/', $content_output);\n\r\n$content_output = str_replace('https:\/\/myfreeonlinetools.com\/resouce\/','https:\/\/myfreeonlinetools.com\/', $content_output);\n\r\n$content_output = str_replace('https:\/\/myfreeonlinetools.com\/donote\/','https:\/\/myfreeonlinetools.com\/', $content_output);<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>You can use any where str replace but I used after used $content_output code.<\/p>\n\n\n\n<p>and check hover on a link href will change with replace text.<\/p>\n\n\n\n<p>str_replace<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>str_replace(find,replace,string,count);<\/code><\/pre>\n\n\n\n<p>ref link : <a href=\"https:\/\/www.php.net\/manual\/en\/function.str-replace.php\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.php.net\/manual\/en\/function.str-replace.php<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress Blog Inner Content Href Link change or update with PHP. Firstly, go to includes directory in the WordPress theme folder below path ..\/blog\/wp-content\/themes\/enfold\/includes in includes folder find loop-index.php Find [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[18,29],"tags":[],"class_list":["post-1834","post","type-post","status-publish","format-standard","hentry","category-blog","category-php"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to change any WordPress blog inner content link href by PHP code - MyFreeOnlineTools<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to change any WordPress blog inner content link href by PHP code - MyFreeOnlineTools\" \/>\n<meta property=\"og:description\" content=\"WordPress Blog Inner Content Href Link change or update with PHP. Firstly, go to includes directory in the WordPress theme folder below path ..\/blog\/wp-content\/themes\/enfold\/includes in includes folder find loop-index.php Find [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\" \/>\n<meta property=\"og:site_name\" content=\"MyFreeOnlineTools\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/LearnSchoolOnline\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-24T09:48:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-24T09:51:51+00:00\" \/>\n<meta name=\"author\" content=\"myfreeonlinetools\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"myfreeonlinetools\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\"},\"author\":{\"name\":\"myfreeonlinetools\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c\"},\"headline\":\"How to change any WordPress blog inner content link href by PHP code\",\"datePublished\":\"2024-01-24T09:48:27+00:00\",\"dateModified\":\"2024-01-24T09:51:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\"},\"wordCount\":150,\"publisher\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#organization\"},\"articleSection\":[\"Blog\",\"PHP\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\",\"name\":\"How to change any WordPress blog inner content link href by PHP code - MyFreeOnlineTools\",\"isPartOf\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#website\"},\"datePublished\":\"2024-01-24T09:48:27+00:00\",\"dateModified\":\"2024-01-24T09:51:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/myfreeonlinetools.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to change any WordPress blog inner content link href by PHP code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#website\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/\",\"name\":\"MyFreeOnlineTools\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/myfreeonlinetools.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#organization\",\"name\":\"MyFreeOnlineTools\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png\",\"contentUrl\":\"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png\",\"width\":387,\"height\":79,\"caption\":\"MyFreeOnlineTools\"},\"image\":{\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c\",\"name\":\"myfreeonlinetools\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g\",\"caption\":\"myfreeonlinetools\"},\"description\":\"Live in Delhi, Working in Gurgaon as Web Designer and Graphic Designer. Developed and Design myfreeonlinetools for online free tools. Also having youtube channel Name with LearnSchoolOnline. Traveling, watching movies, coding are the hobbies.\",\"sameAs\":[\"https:\/\/myfreeonlinetools.com\/\",\"https:\/\/www.facebook.com\/LearnSchoolOnline\/\",\"https:\/\/www.youtube.com\/learnschoolonline\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to change any WordPress blog inner content link href by PHP code - MyFreeOnlineTools","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/","og_locale":"en_US","og_type":"article","og_title":"How to change any WordPress blog inner content link href by PHP code - MyFreeOnlineTools","og_description":"WordPress Blog Inner Content Href Link change or update with PHP. Firstly, go to includes directory in the WordPress theme folder below path ..\/blog\/wp-content\/themes\/enfold\/includes in includes folder find loop-index.php Find [&hellip;]","og_url":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/","og_site_name":"MyFreeOnlineTools","article_author":"https:\/\/www.facebook.com\/LearnSchoolOnline\/","article_published_time":"2024-01-24T09:48:27+00:00","article_modified_time":"2024-01-24T09:51:51+00:00","author":"myfreeonlinetools","twitter_card":"summary_large_image","twitter_misc":{"Written by":"myfreeonlinetools","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/#article","isPartOf":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/"},"author":{"name":"myfreeonlinetools","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c"},"headline":"How to change any WordPress blog inner content link href by PHP code","datePublished":"2024-01-24T09:48:27+00:00","dateModified":"2024-01-24T09:51:51+00:00","mainEntityOfPage":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/"},"wordCount":150,"publisher":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#organization"},"articleSection":["Blog","PHP"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/","url":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/","name":"How to change any WordPress blog inner content link href by PHP code - MyFreeOnlineTools","isPartOf":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#website"},"datePublished":"2024-01-24T09:48:27+00:00","dateModified":"2024-01-24T09:51:51+00:00","breadcrumb":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/myfreeonlinetools.com\/blog\/how-to-change-any-wordpress-blog-inner-content-link-href-by-php-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/myfreeonlinetools.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to change any WordPress blog inner content link href by PHP code"}]},{"@type":"WebSite","@id":"https:\/\/myfreeonlinetools.com\/blog\/#website","url":"https:\/\/myfreeonlinetools.com\/blog\/","name":"MyFreeOnlineTools","description":"","publisher":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/myfreeonlinetools.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/myfreeonlinetools.com\/blog\/#organization","name":"MyFreeOnlineTools","url":"https:\/\/myfreeonlinetools.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png","contentUrl":"https:\/\/myfreeonlinetools.com\/blog\/wp-content\/uploads\/2019\/11\/myfreeonlinetools-blue.png","width":387,"height":79,"caption":"MyFreeOnlineTools"},"image":{"@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/b1eb72e57c554e3b33cfeec477efcc3c","name":"myfreeonlinetools","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/myfreeonlinetools.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b870b17c6c7e3b75d7fe0b8bebfc9cf5?s=96&d=mm&r=g","caption":"myfreeonlinetools"},"description":"Live in Delhi, Working in Gurgaon as Web Designer and Graphic Designer. Developed and Design myfreeonlinetools for online free tools. Also having youtube channel Name with LearnSchoolOnline. Traveling, watching movies, coding are the hobbies.","sameAs":["https:\/\/myfreeonlinetools.com\/","https:\/\/www.facebook.com\/LearnSchoolOnline\/","https:\/\/www.youtube.com\/learnschoolonline"]}]}},"_links":{"self":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/1834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/comments?post=1834"}],"version-history":[{"count":8,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/1834\/revisions"}],"predecessor-version":[{"id":1842,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/posts\/1834\/revisions\/1842"}],"wp:attachment":[{"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/media?parent=1834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/categories?post=1834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myfreeonlinetools.com\/blog\/wp-json\/wp\/v2\/tags?post=1834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}