 +$page_head['json-ld'] = '<script type="application/ld+json">'."\n".
 +'{"@context": "https://schema",'."\n".
 +'"@type": "WebPage",'."\n".
-+'"headline": "'.pun_htmlspecialchars($cur_forum['forum_name']).($p == 1 ? '' : ' ('.sprintf($lang_common['Page'], $p).')').'",'."\n".
-+'"description": "Listings in'.($p == 1 ? '' : ' page '.$p.' of').' the ‘'.pun_htmlspecialchars($cur_forum['forum_name']).'’ subforum at the Textpattern CMS support forum.",'."\n".
-+'"url": "https://forum.textpattern.io/viewforum.php?id='.$id.($p == 1 ? '' : '&amp;p='.$p).'"}'."\n".
++'"headline": '.json_encode(pun_htmlspecialchars($cur_forum['forum_name']).($p == 1 ? '' : ' ('.sprintf($lang_common['Page'], $p).')')).','."\n".
++'"description": '.json_encode(pun_htmlspecialchars('Listings in'.($p == 1 ? '' : ' page '.$p.' of').' the ‘'.pun_htmlspecialchars($cur_forum['forum_name']).'’ subforum at the Textpattern CMS support forum.')).','."\n".
++'"url": "https://forum.textpattern.io/viewforum.php?id='.intval($id).($p == 1 ? '' : '&p='.intval($p)).'"}'."\n".
 +'</script>';
 +$page_head['canonical'] = '<link rel="canonical" href="https://forum.textpattern.io/viewforum.php?id='.$id.($p == 1 ? '' : '&amp;p='.$p).'" title="'.sprintf($lang_common['Page'], $p).'">';
  

+$page_head['json-ld'] = '<script type="application/ld+json">'."\n".
+'{"@context": "https://schema",'."\n".
+'"@type": "WebPage",'."\n".
+'"headline": "'.pun_htmlspecialchars($cur_topic['subject']).($p == 1 ? '' : ' ('.sprintf($lang_common['Page'], $p).')').'",'."\n".
+'"description": "Postings in'.($p == 1 ? '' : ' page '.$p.' of').' the ‘'.pun_htmlspecialchars($cur_topic['subject']).'’ topic in the ‘'.pun_htmlspecialchars($cur_topic['forum_name']).'’ subforum.",'."\n".
+'"url": "https://forum.textpattern.io/viewtopic.php?id='.$id.($p == 1 ? '' : '&amp;p='.$p).'"}'."\n".
+'</script>';
+$page_head['canonical'] = '<link rel="canonical" href="https://forum.textpattern.io/viewtopic.php?id='.$id.($p == 1 ? '' : '&amp;p='.$p).'" title="'.sprintf($lang_common['Page'], $p).'">';
 

 'No sig'						=>	'No signature currently stored in profile.',
 'Signature quote/code/list/h'	=>	'The quote, code, list, and heading BBCodes are not allowed in signatures.',
diff --git a/viewforum.php b/viewforum.php
index 2607a21..6ac1eec 100644
--- a/viewforum.php
+++ b/viewforum.php
@@ -80,20 +80,39 @@ $paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.pa
