Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.4k views
in Q2A Core by
How do i add tag as meta keywords? everytime i try to submit my site for meta review. I can online see meta description and meta keyword is none. How can auto add tag to meta keywords and not description?

I noticed that homepage doesnt have keywords but when i view questions there is keywords. how can i add all the tags to meta keyword on homepage?

2 Answers

+1 vote
by

Firstly meta keywords have absolutely no effect on SEO whatsoever.

However if you definitely want to do this you will need to do a small "core edit". In qa-page.php, look for this code around line 640:

if (!empty($qa_content['keywords']))
    $themeclass->output('<META NAME="keywords" CONTENT="'.$qa_content['keywords'].'"/>');
// as far as I know, META keywords have zero effect on search rankings or listings

Change it to this:

if (!empty($qa_content['keywords']))
    $themeclass->output('<META NAME="keywords" CONTENT="'.$qa_content['keywords'].'"/>');
else
    $themeclass->output('<META NAME="keywords" CONTENT="your keywords here"/>');

Hope that helps!

 

by
the new code should be changed in:

if (strlen(@$this->content['keywords']))
    $this->output('<META NAME="keywords" CONTENT="'.$this->content['keywords'].'"/>');
else
    $this->output('<META NAME="keywords" CONTENT="YOUR KEYWORDS"/>');
by
Actually this should be possible in a custom theme now, because I believe all the HTML in the <head> section is in the theme class, not in the core. This means it will survive Q2A upgrades and not get overwritten.
Remember though, meta keywords have absolutely no effect on SEO whatsoever.
+1 vote
by
Just add a function to your custom theme:

        function head_metas()
        {
            if (!strlen(@$this->content['description'])) $this->output('<META name="description" content="your description here">');
            if (!strlen(@$this->content['keywords'])) $this->output('<META name="keywords" content="your,keywords,here">');
            qa_html_theme_base::head_metas();
        }
...