Removing posts and comments from WordPress

You need to “hook” it to an action, in this case admin_menu:

add_action( 'admin_menu', 'remove_admin_menus' );

Just place it right after the function.

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