{"id":39,"date":"2018-09-24T16:10:15","date_gmt":"2018-09-24T08:10:15","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=39"},"modified":"2018-09-24T16:17:44","modified_gmt":"2018-09-24T08:17:44","slug":"how-to-change-the-wordpress-author-meta-link","status":"publish","type":"post","link":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/how-to-change-the-wordpress-author-meta-link\/","title":{"rendered":"How To Change The WordPress Author Meta Link"},"content":{"rendered":"\n

I needed to change the author link in WordPress post meta. Most of the sites I work on are single author websites, so the Author page is just a copy of the blog page.<\/p>\n\n\n\n

I used to just use Yoast SEO to redirect the Author page to home. That's ok, but it seems a bit of a waste, when you could link to the About page, or just remove the link entirely.<\/p>\n\n\n\n

\"\"<\/figure><\/div>\n\n\n\n

The Post meta is controlled by the\u00a0single.php<\/em> file in your theme. Each theme has a different way to manipulate it. But I wanted something simple and quick.<\/p>\n\n\n\n

So how do you change the WordPress Author meta link? Add a filter to 'author_link<\/em>' and return the url you want to use instead of the default.<\/strong><\/p>\n\n\n\n

The simplest code implementation looks like this:<\/p>\n\n\n\n

add_filter('author_link', 'my_custom_author_link');\n\nfunction my_custom_author_link($link)\n{\n  return home_url('\/about\/');\n}<\/code><\/pre>\n\n\n\n

Whatever you put after\u00a0return<\/em> is the url that will be output to the post meta.<\/p>\n\n\n\n

This code will work on all properly coded themes.<\/p>\n\n\n\n

This will apply to every call to\u00a0get_author_posts_url<\/em>. In 99% of cases, that will only be on the post information. Be sure to check your implementation if you run say a membership site or do some cool, custom coding on the site.<\/p>\n\n\n\n

If you try to\u00a0return false<\/em> or otherwise try to return something blank, you won't get rid of the link. It'll just go to the homepage.<\/p>\n\n\n\n

How Does This Work?<\/h2>\n\n\n\n

When the theme calls\u00a0get_author_posts_url($author_id)<\/em>, it applies the 'author_link<\/em>' filter, passing in the\u00a0$link, $author_id<\/em> and\u00a0$author_nicename<\/em>.<\/p>\n\n\n\n

You can see from the reference<\/a> how it constructs the link.<\/p>\n\n\n\n

If you wanted to conditionally return different links for different authors, your\u00a0add_filter<\/em>\u00a0and function lines would look like this:<\/p>\n\n\n\n

add_filter('author_link', 'my_custom_author_link', 10, 3);\nfunction my_custom_author_link($link, $author_id, $author_nicename) {}<\/code><\/pre>\n\n\n\n

It's important to have the 10 in there, because that denotes the order of the functions running, also known as \"priority\". You don't need to know anything more about it to get this to work. Just make sure the 3 goes in as the fourth item of the\u00a0add_filter<\/em> and matches the same number of arguments passed into the function.<\/p>\n\n\n\n

Alternative Implementations<\/h2>\n\n\n\n

You could also do the\u00a0add_filter<\/em> line like this:<\/p>\n\n\n\n

add_filter('author_link', 'my_custom_author_link', 10, 1);<\/code><\/pre>\n\n\n\n

You might see this implementation in different guides. It's not necessary if you're only using the first argument, like we are. Your code will work either way.<\/p>\n\n\n\n

Some things your code could return are:<\/p>\n\n\n\n

  • home_url()<\/em>; \/\/ straight to home<\/li>
  • \"#\"<\/em>; \/\/ best option if you want to remove the link using this method<\/li>
  • \"http:\/\/www.otherwebsite.com\"<\/em>; \/\/ if you wanted to link your author to an external site, like a blog or social media profile.<\/li><\/ul>\n\n\n\n

    The last one I wouldn't recommend, unless it was a site you own. If you're doing to social media, you'd be better to setup a page with all your social media links on and a bit about you, then link to that.<\/p>\n\n\n\n

    Remember that you have to\u00a0return<\/em> it, so the\u00a0get_author_posts_url()<\/em> has something to return.<\/p>\n","protected":false},"excerpt":{"rendered":"

    I needed to change the author link in WordPress post meta. Most of the sites I work on are single author websites, so the Author page is just a copy of the blog page. I used to just use Yoast SEO to redirect the Author page to home. That’s ok, but it seems a bit<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"yoast_head":"\nHow To Change The WordPress Author Meta Link<\/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:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Change The WordPress Author Meta Link\" \/>\n<meta property=\"og:description\" content=\"I needed to change the author link in WordPress post meta. Most of the sites I work on are single author websites, so the Author page is just a copy of the blog page. I used to just use Yoast SEO to redirect the Author page to home. That's ok, but it seems a bit\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\" \/>\n<meta property=\"og:site_name\" content=\"Intelliwolf\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-24T08:10:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-09-24T08:17:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png\" \/>\n<meta name=\"author\" content=\"Mike Haydon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Haydon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\"},\"author\":{\"name\":\"Mike Haydon\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\"},\"headline\":\"How To Change The WordPress Author Meta Link\",\"datePublished\":\"2018-09-24T08:10:15+00:00\",\"dateModified\":\"2018-09-24T08:17:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\"},\"wordCount\":503,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png\",\"articleSection\":[\"Theme Customization\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\",\"url\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\",\"name\":\"How To Change The WordPress Author Meta Link\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png\",\"datePublished\":\"2018-09-24T08:10:15+00:00\",\"dateModified\":\"2018-09-24T08:17:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage\",\"url\":\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png\",\"contentUrl\":\"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.intelliwolf.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Theme Customization\",\"item\":\"https:\/\/www.intelliwolf.com\/category\/theme-customization\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Change The WordPress Author Meta Link\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.intelliwolf.com\/#website\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"name\":\"Intelliwolf\",\"description\":\"WordPress, Web Design and Coding Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.intelliwolf.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\",\"name\":\"Intelliwolf\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"contentUrl\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"width\":300,\"height\":100,\"caption\":\"Intelliwolf\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\",\"name\":\"Mike Haydon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"caption\":\"Mike Haydon\"},\"sameAs\":[\"https:\/\/intelliwolf.com\/about-mike-haydon\/\"]}]}<\/script>\n","yoast_head_json":{"title":"How To Change The WordPress Author Meta Link","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:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/","og_locale":"en_US","og_type":"article","og_title":"How To Change The WordPress Author Meta Link","og_description":"I needed to change the author link in WordPress post meta. Most of the sites I work on are single author websites, so the Author page is just a copy of the blog page. I used to just use Yoast SEO to redirect the Author page to home. That's ok, but it seems a bit","og_url":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/","og_site_name":"Intelliwolf","article_published_time":"2018-09-24T08:10:15+00:00","article_modified_time":"2018-09-24T08:17:44+00:00","og_image":[{"url":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png"}],"author":"Mike Haydon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mike Haydon","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#article","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/"},"author":{"name":"Mike Haydon","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343"},"headline":"How To Change The WordPress Author Meta Link","datePublished":"2018-09-24T08:10:15+00:00","dateModified":"2018-09-24T08:17:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/"},"wordCount":503,"commentCount":3,"publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"image":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage"},"thumbnailUrl":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png","articleSection":["Theme Customization"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/","url":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/","name":"How To Change The WordPress Author Meta Link","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage"},"image":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage"},"thumbnailUrl":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png","datePublished":"2018-09-24T08:10:15+00:00","dateModified":"2018-09-24T08:17:44+00:00","breadcrumb":{"@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#primaryimage","url":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png","contentUrl":"https:\/\/intelliwolf.com\/wp-content\/uploads\/2018-09-24-author-link-change.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.intelliwolf.com\/how-to-change-the-wordpress-author-meta-link\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.intelliwolf.com\/"},{"@type":"ListItem","position":2,"name":"Theme Customization","item":"https:\/\/www.intelliwolf.com\/category\/theme-customization\/"},{"@type":"ListItem","position":3,"name":"How To Change The WordPress Author Meta Link"}]},{"@type":"WebSite","@id":"https:\/\/www.intelliwolf.com\/#website","url":"https:\/\/www.intelliwolf.com\/","name":"Intelliwolf","description":"WordPress, Web Design and Coding Tutorials","publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.intelliwolf.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.intelliwolf.com\/#organization","name":"Intelliwolf","url":"https:\/\/www.intelliwolf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/","url":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","contentUrl":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","width":300,"height":100,"caption":"Intelliwolf"},"image":{"@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343","name":"Mike Haydon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","caption":"Mike Haydon"},"sameAs":["https:\/\/intelliwolf.com\/about-mike-haydon\/"]}]}},"_links":{"self":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/39"}],"collection":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/comments?post=39"}],"version-history":[{"count":0,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/39\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/media?parent=39"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/categories?post=39"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/tags?post=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}