It looks like you're new here. If you want to get involved, click one of these buttons!
Please can someone provide me an IF statement I can insert somewhere so that any thread pages with a word count below X will have the following added:
<meta name="robots" content="noindex"/>
Reason being is I'd like to try and minimise what might be considered 'thin content' to Google and although word count is only one factor, it's an effective one.
Comments
I think you are taking the phrase too literally
watch this video
https://support.google.com/webmasters/answer/2604719?hl=en
it is nothing to do with succinct discussions. You can have really useful questions that are short, with a single simple answer.
You are far better off encouraging the behaviours you want, rather than trying to prevent indexing on low quality content.
grep is your friend.
I appreciate your point and working the leading SEO agency in Europe, I do have a reasonable grasp of this. The nature of my forum is there are a lot of 'request' one liner topics that offer no value for searchers but it would not be reasonable for me to try and stop that activity.
I understand thin content is not simply about word count but it just so happens that limiting word count in my situation would prevent indexing topics that might get flagged by Panda. Also many of the one liner topics are similar to previous ones, and canonical tags are not an option, so word count restriction would simply rule those similar topics out anyway.
Is there a way to do the IF statement mentioned in first post?
I assume you want to filter on the number of words in the discussion and comments bodies.
You can adjust the word count threshold via the following configuration in
/conf/config.php
:Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Again you will need to encourage your users to make make better topics, there are a number of ways to do that from interface to behavioural incentives.
If you want to add noindex conditionally in a theme hooks file you can add this hook
This will also trap tag only posts such as links and videos, as it is taking a text only version of the body rather then tags which are not easily taken into consideration.
A better idea would to flag this up during posting, by trigging a validation error. To encourage better quality posts.
grep is your friend.
Thanks guys.
Encouraging better discussion really wouldn't help at all. When they create request topics, it is correct for it to only be a couple of sentences and of minimal value to outside world. Ideally I would just put them all in a requests sub-forum and block the directory. However, half of these requests actually turn into discussions and therefore are of value for searchers but I don't have time to moderate and move them on a per topic basis.
+1 very interesting appeal.
VanillaAPP - White label iOS and Android App for Vanilla // Press Theme is ready for Vanilla 2.3+ - Check it out! // Made by VanillaSkins.com
@hgtonight Where exactly do you place your code? I tried in bootstrap.early/before/after.php but it all caused the forum to load a blank page. I tried removing 'public' from your code which allowed the forum load but the code didn't seem to actually work.
Put it in your favorite plugin.
Don't have one?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Never created a plugin before so what I did was I downloaded your 'Testing Ground' and dumped your code at the bottom of class.testingground.plugin.php and it seems to be working. Is this what you had in mind?
Sounds good to me.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight Is your 'Testing Ground' compatible with latest version of Vanilla? When enabled you can't use basic functionality such as deleting topics as it just gives a discussion controller error.
Ok, when I remove 'noindex' code from your plugin container, the forum is fine. So perhaps something in the code you provided me is causing this problem. Any ideas?
Enable the debugger plugin, then the testing ground plugin. This should give you an error instead of an "nice" error.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Ok so I enabled debugger in config and this is what I get when I try and delete a topic:
Please can aonyone figure out why @hgtonight 'noindex' code is causing discussion controller errors on most of the forum functions? Deleting, favouriting etc.
Reminder of @hgtonight 's code:
Huh, thought I had responded to this.
You need to check and make sure the discussion object exists. Replace line 3 with:
You could also improve this by passing the bodies through the format class like @x00 did.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks, that worked!
I did also try @x00 code but my forum were just blank pages but I guess that doesn't matter now anyway.
I've just upgraded from 2.1.x to 2.3.1 and this little hack/plugin is no longer working consistently.
Any ideas?
Please provide the full code...
Normally simple things like that either work or they don't. Is it possible that "this little hack/plugin is no longer working consistently" is based on a misunderstanding on what the plugin should do/can do?
hgtonight adviced you to "passing the bodies through the format class like @x00 did". The difference of counting the words in the body and counting the words in the body formatted to text might be enormous if a discussion contains a lot of links and text formattings. That would be counted as words although you cannot see them when they are displayed.
Furthermore you simply added the code snippet to a plugin template without reading or understanding what is in there. One of the more intersting lines in the plugin is this:
'MobileFriendly' => FALSE, // Should this plugin be run on mobile devices?
. You can read it like that:Question: Should this plugin be run on mobile devices?
Answer: No.
Therefore that optimization wouldn't work for all clients. Not sure how search engines do their crawling but I would always consider that they also might crawl you mobile pages. Since you haven't changed that line, this optimization has never been effective for mobile agents.
But coming back to your question: change this
to that
and this
to that
Thank you and I had no idea about the mobile exclusion. Very important!
A little bit input from my experience for others interested in no-index (not misunderstanding the issue that was asked here, automatization). About a manual approach.
Google is pretty strict on user generated content when it comes to SEO. Especially if you have two or more discussions with similar content (which is likely in communities, and merging two or more topics can confuse things pretty hard) it makes sense to look up with a SEO tool which is ranking better in the SERPs and no-index the other discussions which performs lower (Google could balance them to each other sometimes not clear which one to choose which weakens both discussions).
There is a manual no-index plugin by the Vanilla Team which seemed to be broken ever since:
https://open.vanillaforums.com/addon/noindex-plugin
It has a permission issue (which is also in action on this forum) and also didn't add no-index to the discussion when I tried it.
VanillaAPP - White label iOS and Android App for Vanilla // Press Theme is ready for Vanilla 2.3+ - Check it out! // Made by VanillaSkins.com
The plugin looks good to me. I've just tested it on my Vanilla 2.3.1 test installation.
As long as a role either has
Garden.Moderation.Manage
orGarden.Curation.Manage
rights, users of that role have the right to "Add NoIndex"/"Remove NoIndex"A discussion which is marked with "NoIndex" has the following line added to the head
<meta name="robots" content="noindex,noarchive" />
So from what I can tell, it works exactly as intended.
If you are facing problems, I could think of two scenarios:
1. if you add NoIndex and don't see any difference, you might have seen an outdated version of your page and a refresh might solve that problem (which only exists in your browser)
2. users permissions get cached for a while. So if your users had one of the above mentioned rights, they might still see the option in the discussion options (but they normally should not, maybe they are looking at an outdated version of the page, too). But when they try to use that option, they will be presented with a permission error
@R_J This plugin no longer works with 2.5 upgrade. It shows as enabled in dashboard but has no effect. Any ideas?
This is the log with debug mode enabled:
I just made a post (awaiting moderation for some strange reason) asking why this plugin stopped working with 2.5 but have since found that you just need to change the following:
Before: class TestingGround extends Gdn_Plugin {
After: class TestingGroundPlugin extends Gdn_Plugin {
Hi
That post got caught in the spam queue.