Make (custom) post type accessible only by custom query

Try using 'publicly_queryable' => false when registering your CPT.

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