Git Product home page Git Product logo

taro-sitemap's Introduction

Tarosky Sitemap

Contributors: Takahashi_Fumiki,tarosky
Tags: sitemap,google,news
Requires at least: 5.7
Requires PHP: 7.2
Tested up to: 6.0
Stable Tag: nightly

Sitemap plugin.

Description

This plugin provides sitemap xml. Sitemaps below are available.

  1. Post type sitemap.
  2. Taxonomy sitemap.
  3. Google News sitemap(detail)
  4. Image sitemap(optional for sites with a large size of contents)

The remarkable features of this plugin are:

  • Every type of sitemaps is a independent sitemap index.
  • Sitemap are separated by YEAR-MONTH. This leverages MySQL index and reduce database cpu utilization under bot access. So effective for the sites with huge number of contents.
  • Atatchment site map is also effective for the sites with a lot of attachment files.

Setup

  1. Go to Admin screen -> Tools -> Sitemap and register site map which you want.
  2. Get sitemap URLs and register them at Google Search Console.

Customize

Besides setting on admin screen, some hooks are also available.

Newws Sitemap

By default, news sitemap consists of the posts under specified post type(e.g. post). If you need some condition(e.g. only posts under a category, excluding some tags), use filter hook below:

/**
 * Filter hook for WP_Query arguments for news sitemap.
 *
 * @param array $query_args Which passed to WP_Query
 * @return array
 */
add_filter( 'hms_news_sitemap_query_args', function( $query_args ) {
	// 1. Includes only posts under category "news"
	// 2. Exclude posts with tag "sponsored"
	$query_args['tax_query'] = [
		[
			[
				'taxonomy' => 'category',
				'field'    => 'slug',
				'terms'    => 'news',
			],
			[
				'taxonomy' => 'post_tag',
				'field'    => 'slug',
				'terms'    => 'sponsored',
				'operator' => 'NOT IN',
			],
		],
	];
} );

Installation

  • Download zip and unpack it.
  • Upload under wp-content/plugins
  • Go to admin screen and activate it.

Frequently Asked Questions

Feel free to contact us in GitHub.

Changelog

1.0.0

  • Initial release.

taro-sitemap's People

Contributors

fumikito avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

taro-sitemap's Issues

No Index feature

  • Add no-index setting for post(hide from search engines)
    • Above should also respect Yoast's setting.

Improve docs/readme

  • it adds sitemap entry to robots.txt
    /**
    * Add robots.txt.
    *
    * @param string $txt Robots.txt content.
    * @param bool $public If this site is public.
    * @return string
    */
    public function robots_txt( $txt, $public ) {
    if ( $public ) {
    $txt .= sprintf( 'Sitemap: %s%s', esc_url( $this->build_url() ), "\n" );
    }
    return $txt;
    }
  • add a note about Cache-Control ?
  • add a note about ping url to googl?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.