Now a days, rapidly increasing the use of online social networks (OSNs). Through this services user’s can communicate and transfer any data. The major disadvantage of these Online Social Networking (OSN) services is the lack of privacy for the user’s own private space. We use pattern matching and text classification algorithm for accurate filtering results. We propose a system allowing OSN users to have a direct control on the messages posted on their walls. This is a flexible rulebased system that allows users to customize the filtering process applied to their user’s profiles. A machine learning technique automatically labeling messages in support of content-based filtering. Index Terms: content-based filtering, filtering rule, filtering system, machine learning , online social networks