Context. In clustered environments, stellar encounters can liberate planets from their host stars via close encounters. Although the detection probability of planets suggests that the planet population in open clusters resembles that in the field, only a few dozen planet-hosting stars have been discovered in open clusters. Aims. We explore the survival rates of planets against stellar encounters in open clusters similar to the Pleiades, Hyades, and Praesepe and embedded clusters. Methods. We performed a series of N-body simulations of high-density and low-density open clusters, open clusters that grow via mergers of subclusters, and embedded clusters. We semi-analytically calculated the survival rate of planets in star clusters up to ∼1 Gyr using relative velocities, masses, and impact parameters of intruding stars. Results. Less than 1.5 % of close-in planets within 1 AU and at most 7 % of planets with 1-10 AU are ejected by stellar encounters in clustered environments after the dynamical evolution of star clusters. If a planet population from 0.01-100 AU in an open cluster initially follows the probability distribution function of exoplanets with semi-major axis (a p ) between 0.03-3 AU in the field discovered by RV surveys (∝ a −0.6 p ), the PDF of surviving planets beyond ∼ 10 AU in open clusters can be slightly modified to ∝ a −0.76 p . The production rate of free-floating planets (FFPs) per star is 0.0096-0.18, where we have assumed that all the stars initially have one giant planet with a mass of 1-13 M Jup in a circular orbit. The expected frequency of FFPs is compatible with the upper limit on that of FFPs indicated by recent microlensing surveys. Our survival rates of planets in open clusters suggest that planets within 10 AU around FGKM-type stars are rich in relatively-young ( 10-100 Myr for open clusters and ∼1-10 Myr for embedded clusters), less massive open clusters, which are promising targets for planet searches.