Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
3.9k views
in Q2A Core by

I'm not interested in meta descriptions for SEO or SERP purposes. I am interested in them because they provide relevant info about the site to people who are scanning search results, which has a direct effect on "click-through" rates.

Google shows titles (blue/link) and descriptions (black/text), so it shows descriptions based on the Q2A question's description. However, if there is no question description (just a question title), then Google displays by default the immediate content towards the top of the Q2A site. So, if question title is, "How to you do XYZ?" and additional question info is "How do you change XYZ on the site, etc, etc?", then Google will show these (blue title link/black description text).

But sometimes, a user may just submit a question title which requires no further explanation, such as  "What do you think of XYZ?". In this case, Google will display that title "What do you think of XYZ?" in the search results, but as for the description, since there is no additional question explanation, Google just displays the first (or random) content it encounters on the site, e.g. "Welcome to Q&A site, etc, etc".

Is it possible to specify meta descriptions for title-only posts, tag pages, category pages, etc. Basically, these are pages where there is no unique content besides the title. For example, it would be nice to specify a description for tag pages, e.g. <meta name="description" content="Here are all of the questions that have been tagged with the keyword $keyword at $sitename"/> . And this is what would be displayed on Google. Same thing for title-only questions, [if no description, then]<meta name="description" content="$question_title was asked by $user on $date" at $sitename. />. If nothing else, if a question is posted with a title and no further description, it would be nice to have the question title imported as the given meta-description.

There's a way to do this sort of thing with Wordpress with custom header commands. Here's the Wordpress article

Any ideas? Thanks...

Q2A version: 1.5

2 Answers

+2 votes
by
I found out how to do this.

Although, I don't know how to add to or change the wording, only to import the preset values such as 'main/popular_tags' and 'main/questions_tagged_x'. I'd like to figure out how to add text either before or after these values to show up in the meta data displayed. For example, meta description template would read,  "Feel free to ask a question. Here are 'main/popular_tags' at our question & answer site". (main/popular tags language value being "most popular tags/keywords".)

To edit the main tags summary page to include meta description & keywords:

edit the file /qa-include/qa-page-tags.php

after line 49, add these lines below the $qa_content['title']ETC line...

    $qa_content['description']=qa_lang_html('main/popular_tags');
    $qa_content['keywords']=qa_lang_html('main/popular_tags');

This will add the content based on your language file's values.

Similarly, to add meta description & keywords to the individual tag page:

below line 61 which specifies tag page title: $qa_content['title']=qa_lang_html_sub('main/questions_tagged_x', qa_html($tag));

add the two following lines of code:

$qa_content['description']=qa_lang_html_sub('main/questions_tagged_x', qa_html($tag));

$qa_content['keywords']=qa_lang_html_sub('main/questions_tagged_x', qa_html($tag));

Whatever values 'between the marks like this' that you specify in your /qa-lang files is the wording that will show up in the meta titles, descriptions, and keywords if you add these lines.
0 votes
by

Is your code work with meta keywords with main tags list? it's working with meta description but not meta keywords with my theme.

...