Search engine, SEO friendly

Hi there ! Thanks for your plugin which is a really nice one !

I have modify a lot of things to make it works only with facebook connect.
As you can see here : [removed]
But here few question :
- SEARCH ENGINE WORDPRESS :

The problem is, when i use the search engine of my blog, it shows the questions of your plugin in the results, which can be a really good thing but i don't want them.
So to fix that i have to assign to each question a category that i remove from the results with a little code.

Can you please tell me how can i assign automaticly a category (that i have created in the backoffice of wordpress) to each question?

- SEO FRIENDLY

I want to make your plugin SEO friendly.
-How can i change the name of the sub folder which is actually "questions" : [removed] ?
-How can i change the name for ask ? actually it's [removed] ?
-same with [removed]

NOFOLLOW :
I want to make all the link in the content of a questions and answers on rel="nofollow" , (every link, like : modify, delet, link, author name)

TITLE
I don't know why, but all my title pages show the name of my blog after the question, which i don't want to. On my post there is just the title (h1).
Who can i remove it ?

Thank you for your answer

Best regards.

  • aecnu

    Greetings laurent_dumas,

    Welcome to WPMU Dev!

    Can you please tell me how can i assign automaticly a category (that i have created in the backoffice of wordpress) to each question?

    I do not think that this could be done automatically. It would probably require an algorithm if some sort to determine what category to place an item based on its content in which is way beyond the mandate of this community.

    However, what categories are you using, the questions categories or?

    I want to make your plugin SEO friendly.
    -How can i change the name of the sub folder which is actually "questions" : [removed] ?
    -How can i change the name for ask ? actually it's [removed] ?
    -same with [removed]

    This will take a bit of custom coding in my opinion though I admit I do not know everything. However, I will go ahead and see if I can get the lead developer in here to answer this question offering his invaluable insight and advice to perhaps make this happen if possible.

    NOFOLLOW :
    I want to make all the link in the content of a questions and answers on rel="nofollow" , (every link, like : modify, delet, link, author name)

    More custom coding in which I believe it will be necessary to modify Q&A templates located in /wp-content/plugins/qa/default-templates/ folder. Of course the lead developer may have a better idea then this.

    TITLE
    I don't know why, but all my title pages show the name of my blog after the question, which i don't want to. On my post there is just the title (h1).
    Who can i remove it ?

    I personally use the SEO Ultimate plugin to deal with items of this nature.

    As mentioned earlier I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Hakan

    Hi,

    1) To redefine new locations just include these inside wp-config.php:

    define( 'QA_SLUG_ROOT','questions' );
    define( 'QA_SLUG_ASK', 'ask' );
    define( 'QA_SLUG_UNANSWERED', 'unanswered' );

    Replace the second lines in single quotation marks (questions, ask, unanswered) with your custom slugs.

    2) For nofollow you can use any available plugins. There are several of them in wordpress.org

    3) I didn't understand your question about the title. Can you give an example page for that?

    Cheers,
    Hakan

  • laurent_dumas

    Hi aecnu and thank you for the fast answer,

    I do not think that this could be done automatically. It would probably require an algorithm if some sort to determine what category to place an item based on its content in which is way beyond the mandate of this community.

    However, what categories are you using, the questions categories or?

    Well i have already created the categories, i just need a code to force people to select category when they ask a question. If they don't, they can't send the question.

    Can you please help me with that ?

    For the other point it's okay, i will wait the answer of a developper :slight_smile:

    Best regards

  • Hakan

    Probably we were writing at the same time and you didn't see my answer above.

    For future reference and clarification, if a single category will be used:

    $category_id = 5;

    will also do the work.

    Again for future reference, please note that this is the category id (in correct words, taxonomy term id) of Q&A. In other words, a custom post type cannot be assigned to a regular Wordpress category.

    Cheers,
    Hakan

  • aecnu

    Greetings laurent_dumas,

    I suspect that you and the lead developer Hakan have cross posted since you exclaimed:

    For the other point it's okay, i will wait the answer of a developper :slight_smile:

    In addition, I failed to mention that the plugin I recommended above for dealing with the blog name also has a no follow feature which should kill two birds with one stone.

    Please advise what, if any, issues you are still facing so that between the developer and I we can get this all taken care of.

    Cheers, Joe

  • laurent_dumas

    Thank Hakan and Joe for your fast answer,

    Greatest support ever :slight_smile:

    Hakan,

    thank you it works fine ! Just two little thing.

    If the user don't select any category, it will use the one that i have set in function.php, but when he clicks on "Send", it shows a white page (but it works nice if he select a category).
    So how can i redirect the user to his question post instead of that white page ?

    About the question that you didn't understand, I would like to remove questions from the search engine of wordpress. When an user use "search" of my theme i want to show only posts of my blog, and not the questions of the QA plugin.

    I guess i have to add a filter to function.php to remove category of my questions from the search engine. I've tried this :

    add_filter( 'pre_get_posts', 'qa_search_filter' );
    function qa_search_filter( $query ) {
    
    if ( $query->is_search && !is_admin() )
    $query->set( 'cat','-41, -40, -32, -33, -35, -36, -34, -37' );
    
    return $query;
    
    }

    But it doesn't work.
    Can you help me with that ?

    For the first question :

    define( 'QA_SLUG_ROOT','questions' );
    define( 'QA_SLUG_ASK', 'ask' );
    define( 'QA_SLUG_UNANSWERED', 'unanswered' );

    Doesn't seem to work, my sub page have already the same name after modify :disappointed:

    est regards

  • Hakan

    Hi,

    For the first one, I think it is my mistake that I forget to write the function parameter. You should not be getting a white page there. Sorry about that. Please try this:

    add_filter ('qa_before_add_category', 'force_qa_category' );
    function force_qa_category( $category_id ) {
    	$category_id = 5;
    	return $category_id;
    }

    For the second one, you need to add a meta tag "noindex" to the header of the page. I am not an expert on SEO plugins, but any plugin that supports custom post types should work. I recommend using Joe's suggestion. But if you cannot make it work, use this. I tested it and it works fine:

    function add_noindex_for_qa( ){
    	global $post;
    	if ( 'question' != $post->post_type )
    		return;
    	echo '<meta name="robots" content="noindex,nofollow" />';
    }
    add_action( 'wp_head', 'add_noindex_for_qa' );

    For the third one, did you include it in wp-config.php changing the values like so:

    define( 'QA_SLUG_ROOT','des-questions' );

    Please deactivate and activate the plugin after you made this change.
    Even if that not works go to Permalinks page of WP settings and Save it without making any change (This will flush the permalinks).

    Cheers,
    Hakan

  • laurent_dumas

    Hi,
    Ok now everything works perfectly.

    Ok about the search one, i'm waitting for your answer :slight_smile:

    The only thing which is not working is the question about the name of the subfolder.

    I have included in wp-config.php the good code as you did. I have changed the values, desactivated and activated the plugin, Saved permalinks without making any change.
    And it still not working :disappointed:

    Cheers

  • Hakan

    Hi,

    The "exclude question pages from search" filter will be added in the next version, but I am adding the file which has the changes for you to start using it immediately.

    Replace wp-content/plugins/qa/core/core.php file with the attached one and add these codes inside functions.php of your theme:

    function add_no_search_for_qa( $args ) {
    	$args['exclude_from_search'] = true;
    	return $args;
    }
    add_filter( 'qa_register_post_type_args', 'add_no_search_for_qa' );

    This is tested and works fine for me.

    I also tested custom QA_SLUG_ROOT and it works for me too (after permalink flush). Are you adding those codes before this comment in wp-config.php?

    /* That's all, stop editing! Happy blogging. */

    They should be placed before that comment.

    Cheers,
    Hakan

  • Hakan

    Hi,

    Yes, I have just noticed a note in Wordpress documentation:

    Note: If you want to show the posts's list that are associated to taxonomy's terms, you must set exclude_from_search to false (ie : for call site_domaine/?taxonomy_slug=term_slug or site_domaine/taxonomy_slug/term_slug). If you set to true, on the taxonomy page (ex: taxonomy.php) worpress will not find your posts and/or pagination will make 404 error...

    http://codex.wordpress.org/Function_Reference/register_post_type

    I am afraid using exclude from search and category/tag pages at the same time is not supported by Wordpress itself.

    Maybe in one of the new versions they change this, but unfortunately I have nothing to do about it at the moment.

    Cheers,
    Hakan

  • aecnu

    Greetings laurent_dumas,

    Thank you Hakan for working this ticket hard and finding the root of possibly resolving this issue and pointing out a core WordPress notation that basically this cannot be done.

    I would further like to point out this would be no easy task to overcome since it would require heavy duty WordPress core re-coding to accomplish which is far beyond the mandate of this community and support.

    I am sorry that this did not pan out as we had hoped it would.

    Thank you for being a WPMU Dev Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.