From ea4a309277f2faa4d75f85f264a2cf44f6d7ab9b Mon Sep 17 00:00:00 2001 From: Chun <12265739+rxchun@users.noreply.github.com> Date: Thu, 4 Dec 2025 06:30:02 +0000 Subject: [PATCH 1/2] Fix anonymous author microdata for Google Rich Results ## Summary Adds an empty `` for anonymous post authors to satisfy Google structured data requirements, without affecting registered users. ## Details - When `$microdata` is true and the post author is anonymous, the generated HTML now wraps the author name in: ``` ``` - This prevents Google Rich Results warnings about missing `url`. - **Registered users** (with `` links) are unaffected. - The patch does **not** change any IP display or other functionality. ### Testing - Verified anonymous posts render the proper ``. - Verified registered users continue to render their existing linked name correctly. ### Issue addressed Google structured data requires an `author/url` field. Anonymous authors previously triggered warnings in Rich Results testing tools. --- qa-include/app/format.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qa-include/app/format.php b/qa-include/app/format.php index bf4450305..737086b20 100644 --- a/qa-include/app/format.php +++ b/qa-include/app/format.php @@ -767,7 +767,12 @@ function qa_who_to_html($isbyuser, $postuserid, $usershtml, $ip = null, $microda if ($microdata) { // duplicate HTML from qa_get_one_user_html() - $whohtml = ''; + $whohtml = + ''; } if (isset($ip)) From fd6afa44bbe880de47458ea1736f56f2bb2e150b Mon Sep 17 00:00:00 2001 From: Chun <12265739+rxchun@users.noreply.github.com> Date: Mon, 8 Dec 2025 03:27:39 +0000 Subject: [PATCH 2/2] Fix missing URL in anonymous author microdata for Google Rich Results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The URL needs to contain content, as reported by the webmaster who found this issue. Since there is no default user to reference for anonymous content, or stray content like StackOverflow uses, the best solution here is to set the link to the **Users** page. This ensures that SEO has a valid page to reference without leading to a 404 error. Using `mysite.com/users/anonymous` could be problematic since it might either: - Point to a real user with the username "anonymous," or - Result in a 404 error if such a user doesn’t exist. By pointing to the general **Users** page (`mysite.com/users/`), we avoid these issues and maintain valid structured data without exposing sensitive information or creating misleading URLs. --- qa-include/app/format.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa-include/app/format.php b/qa-include/app/format.php index 737086b20..c3b3aab40 100644 --- a/qa-include/app/format.php +++ b/qa-include/app/format.php @@ -770,8 +770,8 @@ function qa_who_to_html($isbyuser, $postuserid, $usershtml, $ip = null, $microda $whohtml = ''; }