Problem : When wordpress is installed on main domain and you want to set the password to any directory which…