{"id":123096,"date":"2026-05-14T15:00:00","date_gmt":"2026-05-14T15:00:00","guid":{"rendered":"https:\/\/make.wordpress.org\/core\/?p=123096"},"modified":"2026-05-14T14:47:21","modified_gmt":"2026-05-14T14:47:21","slug":"removing-title-attributes-in-author-link-functions","status":"publish","type":"post","link":"https:\/\/make.wordpress.org\/core\/2026\/05\/14\/removing-title-attributes-in-author-link-functions\/","title":{"rendered":"Removing title attributes in author link functions"},"content":{"rendered":"<p class=\"wp-block-paragraph\">WordPress 7.0 removes\u2014or facilitates removing\u2014<code>title<\/code> attributes from links relating to post authors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Author\u2019s Website link (from the user profile)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>get_the_author_link()<\/code> and <code>the_author_link()<\/code> have a new <code>$use_title_attr<\/code> parameter, which can be set to <code>false<\/code> to remove the \u201cVisit <i>Author<\/i>\u2019s website\u201d tooltip. By default, these functions continue to include a <code>title<\/code> attribute.<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:1em\"><code class=\"\">&lt;?php\n\/\/ either\nthe_author_link();\n\/\/ or\necho get_the_author_link();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Default output is the same in 7.0 as in 6.9:<br><code>&lt;a href=\"https:\/\/author.example.com\" title=\"Visit Author&amp;#8217;s website\" rel=\"author external\"&gt;Author&lt;\/a&gt;<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:1em\"><code class=\"\">&lt;?php\n\/\/ either\nthe_author_link( false );\n\/\/ or\necho get_the_author_link( false );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Output in 7.0:<br><code>&lt;a href=\"https:\/\/author.example.com\" rel=\"author external\"&gt;Author&lt;\/a&gt;<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Author\u2019s posts archive link<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The \u201cPosts by <i>Author<\/i>\u201d <code>title<\/code> attribute is removed from the link by default. However, the <code>title<\/code> text is still available for use within the <code>the_author_posts_link<\/code> hook, along with the author\u2019s display name.<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:1em\"><code class=\"\">&lt;?php\n\/\/ either\nthe_author_posts_link();\n\/\/ or\necho get_the_author_posts_link();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Output in 6.9:<br><code>&lt;a href=\"https:\/\/example.org\/author\/author\/\" title=\"Posts by Author\" rel=\"author\"&gt;Author&lt;\/a&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Output in 7.0:<br><code>&lt;a href=\"https:\/\/example.org\/author\/author\/\" rel=\"author\"&gt;Author&lt;\/a&gt;<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Editing the posts link text<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To replace the author name with the \u201cPosts by <i>Author<\/i>\u201d text, use multiple arguments in the <code>the_author_posts_link<\/code> <span tabindex='0' class='glossary-item-container'>filter<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Filter<\/span> <span class='glossary-item-description'>Filters are one of the two types of Hooks <a href=\"https:\/\/codex.wordpress.org\/Plugin_API\/Hooks\">https:\/\/codex.wordpress.org\/Plugin_API\/Hooks<\/a>. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output.<\/span><\/span><\/span>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/**\n * Edits text for the link to the author page of the author of the current post.\n *\n * Add \"Posts by\" before the author's display name (or after the name in some translations):\n * `&lt;a href=\"https:\/\/example.org\/author\/author\/\" rel=\"author\"&gt;Posts by Author&lt;\/a&gt;`\n *\n * @param string $link   HTML link.\n * @param string $author Author's display name. Default empty string.\n * @param string $title  Text originally used for a title attribute. Default empty string.\n *\/\nfunction wpdocs_author_posts_link( $link, $author = '', $title = '' ) {\n\t\/\/ In WordPress versions prior to 7.0, $author and $title would be empty.\n\tif ( '' !== $title &amp;&amp; '' !== $author ) {\n\t\t$link = str_replace(\n\t\t\t'&gt;' . $author . '&lt;\/a&gt;',\n\t\t\t'&gt;' . esc_html( $title ) . '&lt;\/a&gt;', \n\t\t\t$link\n\t\t);\n\t}\n\n\treturn $link;\n}\nadd_filter( 'the_author_posts_link', 'wpdocs_author_posts_link', 10, 3 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Authors list <span tabindex='0' class='glossary-item-container'>HTML<span class='glossary-item-hidden-content'><span class='glossary-item-header'>HTML<\/span> <span class='glossary-item-description'>HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers.<\/span><\/span><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>wp_list_authors()<\/code> simply removes the \u201cPosts by <i>Author<\/i>\u201d tooltips.<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:1em\"><code class=\"\">&lt;?php\nwp_list_authors(\n\tarray(\n\t\t'html' =&gt; true \/\/ This is true by default.\n\t)\n);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Output in 6.9:<br><code>&lt;li&gt;&lt;a href=\"https:\/\/example.org\/author\/author\/\" title=\"Posts by Author\"&gt;Author&lt;\/a&gt;&lt;\/li&gt;&lt;li&gt;&lt;a href=\"https:\/\/example.org\/author\/editor\/\" title=\"Posts by Editor\"&gt;Editor&lt;\/a&gt;&lt;\/li&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Output in 7.0:<br><code>&lt;li&gt;&lt;a href=\"https:\/\/example.org\/author\/author\/\"&gt;Author&lt;\/a&gt;&lt;\/li&gt;&lt;li&gt;&lt;a href=\"https:\/\/example.org\/author\/editor\/\"&gt;Editor&lt;\/a&gt;&lt;\/li&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more information, refer to <a href=\"https:\/\/core.trac.wordpress.org\/ticket\/62835\">#62835<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p class=\"wp-block-paragraph\">Props to <a href=\"https:\/\/profiles.wordpress.org\/amykamala\/\" class=\"mention\"><span class=\"mentions-prefix\">@<\/span>amykamala<\/a> and <a href=\"https:\/\/profiles.wordpress.org\/audrasjb\/\" class=\"mention\"><span class=\"mentions-prefix\">@<\/span>audrasjb<\/a> for review.<\/p>\n<p class=\"o2-appended-tags\"><a href=\"https:\/\/make.wordpress.org\/core\/tag\/7-0\/\" class=\"tag\"><span class=\"tag-prefix\">#<\/span>7-0<\/a>, <a href=\"https:\/\/make.wordpress.org\/core\/tag\/dev-notes\/\" class=\"tag\"><span class=\"tag-prefix\">#<\/span>dev-notes<\/a>, <a href=\"https:\/\/make.wordpress.org\/core\/tag\/dev-notes-7-0\/\" class=\"tag\"><span class=\"tag-prefix\">#<\/span>dev-notes-7-0<\/a><\/p><nav class='o2-post-footer-actions'><ul class='o2-post-footer-action-row'><li class='o2-post-footer-action'><a href=\"https:\/\/login.wordpress.org\/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcore%2F2026%2F05%2F14%2Fremoving-title-attributes-in-author-link-functions%2F%23respond&#038;locale=en_US\" title=\"Login to Reply\"  class=\"genericon  genericon-reply\"  data-action=\"login-to-reply\"  data-actionstate=\"default\" >Login to Reply<\/a><\/li><\/ul><div class='o2-post-footer-action-likes'><\/div><ul class='o2-post-footer-action-row'><\/ul><\/nav>","protected":false},"excerpt":{"rendered":"<p>WordPress 7.0 removes\u2014or facilitates removing\u2014title attributes from links relating to post authors in the following functions: get_the_author_link(), the_author_link(), get_the_author_posts_link(), the_author_posts_link(), and wp_list_authors().<\/p>\n","protected":false},"author":14394218,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1175],"tags":[5676,1443,5834],"class_list":["post-123096","post","type-post","status-publish","format-standard","hentry","category-general","tag-7-0","tag-dev-notes","tag-dev-notes-7-0","mentions-amykamala","mentions-audrasjb","author-sabernhardt"],"revision_note":"","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2AvED-w1q","_links":{"self":[{"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/posts\/123096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/users\/14394218"}],"replies":[{"embeddable":true,"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/comments?post=123096"}],"version-history":[{"count":9,"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/posts\/123096\/revisions"}],"predecessor-version":[{"id":123215,"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/posts\/123096\/revisions\/123215"}],"wp:attachment":[{"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/media?parent=123096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/categories?post=123096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/make.wordpress.org\/core\/wp-json\/wp\/v2\/tags?post=123096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}