We construct correlation-consistent effective core potentials (ccECPs) for a selected set of heavy atoms and f elements that are currently of significant interest in materials and chemical applications, including Y, Zr, Nb, Rh, Ta, Re, Pt, Gd, and Tb. As is customary, ccECPs consist of spin-orbit (SO) averaged relativistic effective potential (AREP) and effective SO terms. For the AREP part, our constructions are carried out within a relativistic coupled-cluster framework while also taking into account objective function one-particle characteristics for improved convergence in optimizations. The transferability is adjusted using binding curves of hydride and oxide molecules. We address the difficulties encountered with f elements, such as the presence of large cores and multiple near-degeneracies of excited levels. For these elements, we construct ccECPs with core-valence partitioning that includes 4f subshell in the valence space. The developed ccECPs achieve an excellent balance between accuracy, size of the valence space, and transferability and are also suitable to be used in plane wave codes with reasonable energy cutoffs.