Personalized web search (PWS) has improved various search services on internet. Now a days, as the reluctance of the users has been increased to hide their private information while searching. This has become the major problem for the wide proliferation of PWS. Here, we study how to protect PWS applications, so that user preferences can model as hierarchical user profiles. In this we are proposing a PWS framework known as UPS which can generalize user profiles by using queries with some privacy requirements. During run time generalization, it aims a balance between two predictive metrics which evaluate the use of personalization and privacy risk ij exposing their generalized profile. In run time generalization, we are presenting two greedy algorithms, Greedy DP and GreedyIL. Moreover, we are using an online prediction mechanism to decide whether personalizing a query is beneficial or not. This results the GreedyIL significantly outperforms GreedyDP in terms of efficiency.