Grid cells with stable hexagonal firing patterns in the medial entorhinal cortex (MEC) carry the vital function of serving as a metric for the surrounding environment. Whether this mechanism processes only spatial information or involves nonspatial information remains elusive. Here, we fabricated an MEC-shaped microelectrode array (MEA) to detect the variation in neural spikes and local field potentials of the MEC when rats forage in a square enclosure with a planar, three-dimensional object and social landmarks in sequence. The results showed that grid cells exhibited rate remapping under social conditions in which spike firing fields closer to the social landmark had a higher firing rate. Furthermore, global remapping showed that hexagonal firing patterns were rotated and scaled when the planar landmark was replaced with object and social landmarks. In addition, when grid cells were activated, the local field potentials were dominated by the theta band (5–8 Hz), and spike phase locking was observed at troughs of theta oscillations. Our results suggest the pattern separation mechanism of grid cells in which the spatial firing structure and firing rate respond to spatial and social information, respectively, which may provide new insights into how the brain creates a cognitive map.