Google Search Console: lots of pages not indexed

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Satusnovus
Registered User
Posts: 105
Joined: Mon Sep 12, 2016 9:44 pm

Google Search Console: lots of pages not indexed

Post by Satusnovus »

I've posted this at another subject and was told to install an extension. I'm searching for coding for a solution and not necessarily an extension.

I have an issue that shows up in Google Search Console:
Discussion Forum: 99% of your items don't qualify for advanced results
Check and fix issues that invalidate your items.
https://developers.google.com/search/do ... sion-forum
I have no idea what code to add now so that Google can properly index my forum in their search engine. Does anyone have a solution?
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6516
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Google Search Console: lots of pages not indexed

Post by thecoalman »

I've not seen that suggestion in search console yet. When they are saying "99% of your items don't qualify for advanced results" they are referring to specific search services. You may see "forum results" when searching, I have phpBB pages showing up in those results.

I know you were directed to custom coding but this would require extensive work. Generally speaking custom coding is for simple one off edits or to get help with your own custom coding for phpBB.

This topic was already brought up in Ideas apparently by Google employee. There is response from Marc who is the lead developer for phpBB. It may be included with future releases of phpBB.

viewtopic.php?t=2638946
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
Satusnovus
Registered User
Posts: 105
Joined: Mon Sep 12, 2016 9:44 pm

Re: Google Search Console: lots of pages not indexed

Post by Satusnovus »

I'm not sure it's extensive work. Searching online for a solution came to this:

Structured data should be added in JSON-LD:
{
"@context": "https://schema.org",
"@type": "Article",
"author": {
"@type": "Person",
"name": "Jan Jansen",
"url": "https://voorbeeld.nl"
}
}
I've no idea if this should be added in the header but I'm getting close. Unfortunately phpbb isn't that well for SEO and you'll need extra coding or extensions.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6516
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Google Search Console: lots of pages not indexed

Post by thecoalman »

How simple it is depends. I've been looking at this myself now that I'm aware of it. Between the heads tags is correct location based on Google documentation. I don't know if it can be placed anywhere else.Not sure if you can use external file but if you can you might want to look at feed.php for how you might implement as external file.

For the head tags In the template viewtopic_body.html is loop for the topics, you can try to use it in overall_header.html. Anywhere between the heads tags add:

Code: Select all

<!-- IF S_VIEWTOPIC-->
<!-- BEGIN postrow -->
{postrow.POST_AUTHOR_FULL} 
<!-- END postrow -->
<!-- ENDIF -->
Purge the cache, you always need to purge the cache after template edit. Load a viewtopic page with your browser and view the source code, if it worked you should have list of post authors. If that does work you are most of the way there, most if not all the template variables are already available.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
SQLnovice
Registered User
Posts: 159
Joined: Thu Oct 10, 2019 5:03 am

Re: Google Search Console: lots of pages not indexed

Post by SQLnovice »

I've implemented your code into our forum's overall_header.html <head> section and will check back with any improvements in GSC's comments. I can confirm that coalman's code identifies all topic username authors in the topic's page source code too, once each for each post contained in the topic.

However, upon testing, each topic page now shows those usernames as the first line in a string across the top of each topic, above the forum logo. If I insert the code into viewtopic_body.html, it does the same thing, only under the logo and forum toolbars. Is there a way to hide the code, to prevent it from displaying?
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6516
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Google Search Console: lots of pages not indexed

Post by thecoalman »

SQLnovice wrote: Sat Dec 14, 2024 5:57 pm However, upon testing, each topic page now shows those usernames as the first line in a string across the top of each topic,
I guess I should of made this clear. It was just a test to see if the data you need is available in overall_header.html. Remove it if it's live board. For testing and development install XAMPP:

https://www.phpbb.com/support/docs/en/3 ... eb-server/

Just so it's 100% clear the following is not working example. <!-- BEGIN postrow --> is a loop and will loop through every post. The template variables available like post text, date, author etc. can be found in viewtopic,php around line 2028, e.g. {postrow.POST_DATE_RFC3339} is post date you would want to use.

Code: Select all

<!-- IF S_VIEWTOPIC-->
// Non repeated code 
<!-- BEGIN postrow -->
//repeated code
"author": {
"@type": "Person",
"name": "{postrow.POST_AUTHOR_FULL}"
}
<!-- END postrow -->
// More non repeated code
<!-- ENDIF -->
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison

Return to “phpBB Custom Coding”