An online social network (OSN) gives users a strong platform to communicate and exchange information. Protecting publicly published data from individual identification is the primary problem in sharing social network databases. The most popular method for protecting privacy is anonymizing data, which involves deleting or altering some information while maintaining as much of the original data as feasible. This work presents a combination anonymizing algorithm, which is based on k member Gaussian kernel fuzzy c means clustering and self-adaptive honey badger optimization technique (KGKFCM-SAHBO). As part of the suggested anonymization process, the various users are divided into C clusters, each of which has at least K users, using a K-member Gaussian kernel fuzzy c means clustering technique. After that, the primary clusters are further optimized using the self-adaptive honey badger optimization approach (SAHBO) to further anonymize the data and network graph. Using the Yelp dataset, the experimental findings demonstrate the efficiency of the proposed model and evaluate a number of parameters, including execution time, degree of anonymization, and information loss. The experimental results show that the proposed strategy reduced information loss and improved the degree of anonymization when compared to existing methodologies.