I have a few rewrite rules that allow me to have specific URLs for search paremeters. For reference, they are:
add_filter('rewrite_rules_array', 'mmp_rewrite_rules');
function mmp_rewrite_rules($rules)
{
$newRules = array();
$newRules['floorplan/(.+)/(.+)/(.+)/?$'] = 'index.php?floorplan=$matches[3]';
$newRules['ready-made/(.+)/(.+)/(.+)/?$'] = 'index.php?ready_made=$matches[3]';
$newRules['floorplan/(.+)/(.+)/?$'] = 'index.php?county=$matches[2]';
$newRules['ready-made/(.+)/(.+)/?$'] = 'index.php?county=$matches[2]';
$newRules['floorplan/(.+)/?$'] = 'index.php?county=$matches[1]';
$newRules['ready-made/(.+)/?$'] = 'index.php?county=$matches[1]';
return array_merge($newRules, $rules);
}
My concern now is that with these wildcards within them, you can essentially put anything in those slots and be navigated to the correct page, as long as the rest of the URL is valid.
I'm still very shaky on understanding the SEO side of things, and how links are indexed in general. Is this a huge problem, and if so, how can I address it?
I have a few rewrite rules that allow me to have specific URLs for search paremeters. For reference, they are:
add_filter('rewrite_rules_array', 'mmp_rewrite_rules');
function mmp_rewrite_rules($rules)
{
$newRules = array();
$newRules['floorplan/(.+)/(.+)/(.+)/?$'] = 'index.php?floorplan=$matches[3]';
$newRules['ready-made/(.+)/(.+)/(.+)/?$'] = 'index.php?ready_made=$matches[3]';
$newRules['floorplan/(.+)/(.+)/?$'] = 'index.php?county=$matches[2]';
$newRules['ready-made/(.+)/(.+)/?$'] = 'index.php?county=$matches[2]';
$newRules['floorplan/(.+)/?$'] = 'index.php?county=$matches[1]';
$newRules['ready-made/(.+)/?$'] = 'index.php?county=$matches[1]';
return array_merge($newRules, $rules);
}
My concern now is that with these wildcards within them, you can essentially put anything in those slots and be navigated to the correct page, as long as the rest of the URL is valid.
I'm still very shaky on understanding the SEO side of things, and how links are indexed in general. Is this a huge problem, and if so, how can I address it?
Share Improve this question asked Jul 15, 2020 at 17:22 itsseanlitsseanl 535 bronze badges1 Answer
Reset to default 1This is somewhat opinion based answer, and is specific to SEO, not necessarily Wordpress.
Generally a URL should refer to a specific entity, and a/b/c often implies a relationship between a/b/c like b is a parent or container of c, a is a parent or container of b. So it doesn't make much sense that a/b/c, b/a/c and x/y/c all reference the same thing.
SEO with page rank (the basis of Google's search results) works by conferring a higher score to pages that have more pages linking to them. So if for some reason you end up with 3 popular URL's a/b/x, c/d/x and /e/f/x that all show the same content x, then you've lost some SEO rank because if everyone referred to a/b/x it would rank higher.
OTOH, I don't see that this will do any harm. It leaves you open to people publishing abusive URL's maliciously, or messing up URL's accidentally, but this is likely possible in some way with most websites. It also means that in future if you decide to fix/change this you have to allow for all the formats that people have used that are live on the web so those links don't break.
I would be more worried about making sure that URL's used in promoting and internally on the site follow a consistent pattern. If you can, pick one form and use it everywhere.
HTH