• Resolved supernoze

    (@supernoze)


    Dear Khang Minh, I’ve just send you a cup of coffee for your excellent plugin! Love it!

    Just one question … on the last BWP version (1.3), I’ve edited the file “class-bwp-simple-gxs.php” to put some google news keywords so that they will become a ‘default’ keyword for all posts. My website is specific about sports and soccer and following the standard google news keyword >> https://support.google.com/news/publisher/answer/116037?hl=en

    So on ver 1.3 I’ve edited this part (adding sports and soccer) on class-bwp-simple-gxs.php:

    ‘news_keywords’ => “\n\t\t\t” . ‘<news:keywords>Sport, Soccer, %s</news:keywords>’,

    And now, I don’t know where to put those keywords on the new version 1.4

    Please help ?? and thank you in advance

    https://www.ads-software.com/plugins/bwp-google-xml-sitemaps/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Khang Minh

    (@oddoneout)

    Ah thank you, drinking it at the moment!

    There’s a better way to do this, without modifying plugin’s code.

    First, take a look at: https://api.betterwp.net/bwp-google-xml-sitemaps/master/hooks.html#filter_bwp_gxs_news_keyword_map

    The trick here is to map an actual category name (such as “soccer”) to “Sport, Soccer”, so that any articles having that category will instead have “Sport, Soccer” as keyword.

    However, if your posts do not share the same category, you can try editing this file: src/modules/post_google_news.php, go to line 198, and add BEFORE:

    array_push($keywords, 'Sport', 'Soccer');

    I might consider adding an option or a hook for this, let me know if there’s anything else that can make this more friendly.

    Hope that helps!

    Thread Starter supernoze

    (@supernoze)

    AWESOME! You’re the best!!! Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Google News Keywords’ is closed to new replies.