How to insert NOINDEX,NOFOLLOW meta tags for app sections of your InVision Forum

So I ran across a question at EarnerHub, asking how to NoIndex, NoFollow a blog section of a forum powered by Invision Forum Software

Seemed to me that there should be a plugin or something to take care of this right?

Well, I couldn’t find any, so here is how I helped solve for it…

Edit Your InVision Forum Theme

Head on over to your themes section and click the edit theme icon… Just follow the image below…

Edit Global Template

Next, look for a template called globalTemplate…

Templates->Core->Front->Global->globalTemplate

Add Our Own Variable

To not interfere with existing variables, I created a new one and called it $seo_url_check…

First I clicked on the “Variable” button…

Then I added the new variable name to the comma separated list of existing variables…

Check URL Insert Meta

Lastly, I use the following code to check if the forum user is currently viewing a page generated by the “blog” app, if so, insert the meta tags, else do nothing…


{{ $seo_url_check = \IPS\Request::i()->url()->hiddenQueryString['app'];}}
{{if($seo_url_check=='blog')}} <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> {{endif}}

I could get very granular and grab query string parameters by access the data portion of the URL object…


{{ $seo_url_check = \IPS\Request::i()->url()->data['path'];}}

But for this purpose, InVision provides the app being used and makes it pretty easy to take broad action and add NOINDEX,NOFOLLOW meta tag to anything in the “blog” area…

HTH
😉

P.S. Seems to me like there is a huge opportunity here for an SEO plugin of sorts to help manage applications, in this case the blog section is unmoderated user generated content, so it would seem like a great candidate for NoIndex, NoFollow, at the very least, NoFollow…

Would be really cool if there was a plugin where I could just set meta tags for an entire application, perhaps even set specific header footer javascript options or other small modifications based on the application…

Just an idea, post your comments below or if you do make the plugin, post a link to it below!

what do you think?