How can I get wordpress slug without certain phrase? [closed]

Previous answer here.

You’ll want to use str_replace

$permalink = get_the_permalink(); 
$permalink = str_replace("dog-", "", $permalink);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)