You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在WordPress网站嵌入的Google地图中隐藏评论区域

Hey there! Let's tackle how to hide the reviews section in that Google Maps info box on your WordPress site. Here are a couple of reliable methods depending on how you've embedded the map:

Method 1: Custom CSS (Most Universal Approach)

Google Maps info boxes use specific CSS classes for different sections, including reviews. You can target that class with custom CSS to hide the reviews area entirely:

  • First, identify the exact class of the reviews section: Right-click on the reviews part of the info box and select "Inspect" (Chrome/Firefox) to open developer tools. You’ll likely spot a class like .gm-reviews-container, .gm-review-card, or .gm-review-summary (the exact name might vary slightly by map version).
  • Once you have the class, add this CSS to your WordPress site:
    /* Hide Google Maps info box reviews section */
    .gm-reviews-container {
        display: none !important;
    }
    
    If that class doesn’t work, swap it out for the one you found in the inspector (e.g., .gm-review-summary).
  • To add this CSS in WordPress:
    1. Head to Appearance > Customize in your WP admin dashboard.
    2. Navigate to the Additional CSS section.
    3. Paste the code above and click Publish.
Method 2: Adjust Direct Embed Code Parameters

If you embedded the map using Google’s native embed code (not a WordPress plugin), you can add a parameter to disable reviews directly:

  • When generating the embed code from Google Maps, look for the "Hide reviews and ratings" toggle in the embed settings. If you already have the code, append &reviews=0 to the end of the src URL. For example:
    <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3022.xxxxxx!2d-73.xxxxxx!3d40.xxxxxx!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c2xxxxxx%3A0xxxxxxx!2sYour+Location!5e0!3m2!1sen!2sus!4v16xxxxxxxxx!5m2!1sen!2sus&reviews=0" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
    
    This parameter tells Google Maps to exclude the reviews section from the info box.
Method 3: Plugin-Specific Settings (If Using a WP Map Plugin)

If you’re using a WordPress map plugin like WP Google Maps or Google Maps Widget, check the plugin’s settings for a built-in toggle:

  • Look for sections labeled "Info Window Content", "Ratings & Reviews", or similar. Most plugins let you disable reviews in the info box with a simple checkbox, no code needed.
  • For example, in WP Google Maps: Go to Maps > Edit Map > Info Window tab, then uncheck the "Show Reviews" option.

Note: Google occasionally updates their Maps API or CSS class names, so if the CSS method stops working later, just re-inspect the reviews element to find the updated class name.

内容的提问来源于stack exchange,提问作者Awadhesh Singh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 09:40:21