WordPress – Rewrite rules and meta description

I have a problem when I use ‘add_rewrite_rule‘ function in my functions.php file.

function custom_rewrite_rule() {
  add_rewrite_rule('^materiels/([a-z0-9-]+)/(vente|location)$/?','index.php?page_id=3&matos=$matches[1]&mode=$matches[2]','top');
}

The rewrite rule works fine but I have a problem with the meta tittle and meta description. The meta that appear in my HTML page is the meta entered in my WordPress page not in my article linked by the rewrite rule.

Read More

What can I do to fix it?

Related posts