Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
499 views
in Plugins by

I want to add a <META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW"> tag to the q2afaq plugin generated pages and any other pages. How to generate it in php files or normally created pages?

Q2A version: 1.5.4

1 Answer

0 votes
by
selected by
 
Best answer

At last I found the solution:

I have added these codes in the qa-theme.php file after the first "{".

 

function head_metas()
        {
            if ($_SERVER['REQUEST_URI'] == '/login') $this->output('<meta name="robots" content="noindex, follow">');
            if ($_SERVER['REQUEST_URI'] == '/register') $this->output('<meta name="robots" content="noindex, follow">');
            if ($_SERVER['REQUEST_URI'] == '/admin') $this->output('<meta name="robots" content="noindex, follow">');
            if ($_SERVER['REQUEST_URI'] == '/faq') $this->output('<meta name="robots" content="noindex, follow">');
            qa_html_theme_base::head_metas();
        }
This will add meta info to the requested pages.
...