Metadata plays an essential role in facilitating data organizing, finding, and understanding, but it also contains lots of sensitive information about the data and the data users, e.g., the location where a picture was taken. In practice, when sensitive data is encrypted before being uploaded to untrusted public clouds, an oblivious dilemma comes: if the metadata is totally encrypted , and its functionalities no longer exist; otherwise, sensitive information may be leaked. Hence, a secure and flexible mechanism for processing different fields (marked private or public for different scenario needs) of metadata simultaneously is desirable. We searched the literature for methods of achieving such a goal, it turned out that this was not explicitly considered or reasonably solved before. Therefore, in this paper, we investigate the problem of constructing privacy-enhancing metadata, namely, 1) flexible and tamper-resistant metadata setting, 2) owner enabled secure search authorization with explicit metadata. Based on the concept of public key encryption with keyword search (PEKS), we propose a novel Authorized Keyword Search over Encrypted Data with Metadata scheme (MD-AKS), which firstly well addressed the above demands.We formalize the security model and prove the security of MD-AKS scheme. Our work maximizes the flexibility of metadata setting in two aspects: the associated metadata can be set as an arbitrary string and the costs of clients are independent of explicit metadata’s complexity. We implement MD-AKS, the theoretical comparison and experiment results further demonstrate the usability and scalability.