vendredi 4 mars 2016

Wordpress shortcode and SEO

I have a problem with my website. It's a quite huge website with a few thousands of pages, but google doesn't see most of them. I created sitemap and in google tools I see info that google see this sitemap but doesn't index this website. I guess I know where is a problem, but I don't know how to fix it.

Most of websites is based on plugin for wordpress which I created and this plugin display different content on the same page via shortcode. For different addresses I use something like this:

add_action( 'wp_loaded','my_flush_rules' );
add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );
add_filter( 'query_vars','my_insert_query_vars' );

And functions:

function my_flush_rules() {
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
}

// I made this function shorter for the question
function my_insert_rewrite_rules( $rules ) {
    $newrules = array();

    $newrules['my_long_regexp'] = 'index.php?some_variable=$matches[1]';
    $newrules['my_another_long_regexp'] = 'index.php?some_another_variable=$matches[1]';
    $newrules['my_last_long_regexp'] = 'index.php?last_variable=$matches[1]';

    return $newrules + $rules;
}

// I made this function shorter for the question
function my_insert_query_vars( $vars ) {
    array_push($vars, 'some_variable', '...');
    return $vars;
}

Redirection work correctly, but google still doesn't see my pages - only one where is my shortcode...

Do you have any idea what is wrong with my website? I'll be really grateful for help.

Cheers! Adam



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire