5.0.4 Overview
Console - Indexing API is a Joomla CLI application that submits recently published articles from a cron job, and allows a user to submit individual URLs via CLI.
Installation
- Download: Grab the latest version of Console - Indexing API from richeyweb.com.
- Install: Log in to your Joomla administrator area, navigate to System > Install > Extensions, and upload the plugin package.
- Enable: Go to System > Manage > Plugins, search for "Console - Indexing API," and enable it.
The plugin is now installed but requires an initial configuration prior to setting up the cron job. Whatever number of hours you choose for your cron interval, that same value needs to be set in this plugin configuration. If you choose to run your cron job daily, choose the default 24 hours.
Usage
Console - Indexing API operates as a Joomla CLI application. Its two commands:
- php joomla.php indexingapi:published
- php joomla.php indexingapi:submit --url="https://your-awesome-url"
Running the indexingapi:published Command
From your server’s command line, navigate to your Joomla CLI directory and execute:
php /path/to/joomla/cli/joomla.php indexingapi:published
- Replace /path/to/joomla/ with your Joomla root directory.
- The command searches your site for items which were recently published using the following criteria:
- state/published = 1
- access is either 1 or 5 (public or guest)
- publish_up is greater than created (indicating future publish date)
- publish_up is greater than now (it has reached the publish_up date)
- publish_up is LESS THAN the interval you set in the configuration (so we don't spam updates to the search engines)
Automating Updates with Cron
To keep the list current, set up a cron job. Edit your server’s crontab and add:
0 0 * * * php /path/to/joomla/cli/joomla.php indexingapi:published
- This runs fetch daily at midnight (server time).
- Adjust the schedule (e.g., 0 12 * * * for noon) or path as needed.
Running the indexingapi:submit Command
The second mode of operation allows you to submit specific URLs to your configured search engines. Usage is simple, requiring only one command line flag: --url=""
php /path/to/joomla/cli/joomla.php indexingapi:submit --url="https://your-super-awesome-url"
This option allows you to submit or resubmit URLs from your CLI. Being parameterized, you can use this CLI to submit a list of URLs if you choose. I will not provide a tutorial on that, because of the potential for abuse by those who may not understand the implications. By the time you understand what abuse of this system might look like, you'll already understand how to do it.
Integration
Console - Indexing API uses/requires Content - Indexing API to be installed and enabled. Currently, it requires Content - Indexing API to be set to access level Public. This is something I'm working on - and may be more flexible in J6.