Replies: 0
Recently I started noticing my homepage ranking results in Google changed. Normally just the homepage url was indexed and ranked, now when Googling some keywords, strange homepage url variations showup in Google. I found 3 of them:
mywebsite.com/?option=com_content&view=frontpage&Itemid=28
mywebsite.com/?option=com_content&view=frontpage&Itemid=75/
mywebsite.com/?option=com_k2&view=item&id=2%3Ahow-it-works%3F&Itemid=55
All these urls display the homepage and I have no idea where they came from or how to remove them.
I found a solution below, I just need to know how to include com_k2 in the statement as well.
Thank you very much.
add_action( 'wp', 'force_404_bad_query' );
function force_404_bad_query() {
if ( (isset($_REQUEST["option"]) && ($_REQUEST["option"] == "com_content") )) {
status_header( 404 );
nocache_headers();
include( get_query_template( '404' ) );
die();
}
}
-
This topic was modified 10 hours, 7 minutes ago by
ezflow.