Usage

Prerequisities

To use console commands you need access to your server command line. The entry point of Joomla! Console is located in /cli subfolder of your Joomla! installation, and is executed like this: php cli/joomla.php when in Joomla! installation root folder.

It will show you list of available commands, and instructions how to use it. Further information could be found for example here.

Important!

All actions described here modify directly database values, and are not reversible. If you are not sure, take backup first.

Configuration

There are no special configutration options for this plugin.

Available commands

Content Articles

Commands related to Articles.

Aliases

Validate aliases for all articles (checks if aliases contains just allowed characters, useful after batch SQL import):

php cli/joomla.php n3ttools:content:articles:aliases

Regenerate aliases for all articles from their titles:

php cli/joomla.php n3ttools:content:articles:aliases --from-title

Assets

Validate assets for all articles and recreates it when necessary. Also creates correct Worflow state, if missing (useful after batch SQL import):

php cli/joomla.php n3ttools:content:articles:assets

Clean HTML

Cleans introtext and fulltext HTML for all articles:

php cli/joomla.php n3ttools:content:articles:cleanhtml
  • removes class, style, id and events on... attributes,
  • removes script, style, span and font tags
  • strips empty div, strong, span, em, b and i tags
  • decodes HTML entities

Replace

Removes 'whatever':

php cli/joomla.php n3ttools:content:articles:replace whatever

Replaces 'John Doe' text to 'Jane Doe':

php cli/joomla.php n3ttools:content:articles:replace "John Doe" "Jane Doe"

Replaces links to example.com to another.com using regular expression:

php cli/joomla.php n3ttools:content:articles:replace --regex "~https?://(www.)?example.com~" "https://www.another.com"

Replaces bold texts to underline texts:

php cli/joomla.php n3ttools:content:articles:replace --regex "~<strong>(.*?)</strong>~si" "<u>$1</u>"

Note

Replacement occurs in title, introtext, fulltext, Meta description and META keywords in all categories.

Content Categories

Commands related to Articles categories.

Aliases

Validate aliases for all categories (checks if aliases contains just allowed characters, useful after batch SQL import):

php cli/joomla.php n3ttools:content:categories:aliases

Regenerate aliases for all categories from their titles:

php cli/joomla.php n3ttools:content:categories:aliases --from-title

Assets

Validate assets for all categories and recreates it when necessary (useful after batch SQL import):

php cli/joomla.php n3ttools:content:categories:assets

Clean HTML

Cleans description HTML for all categories:

php cli/joomla.php n3ttools:content:categories:cleanhtml
  • removes class, style, id and events on... attributes,
  • removes script, style, span and font tags
  • strips empty div, strong, span, em, b and i tags
  • decodes HTML entities

Replace

Removes 'whatever':

php cli/joomla.php n3ttools:content:categories:replace whatever

Replaces 'John Doe' text to 'Jane Doe':

php cli/joomla.php n3ttools:content:categories:replace "John Doe" "Jane Doe"

Replaces links to example.com to another.com using regular expression:

php cli/joomla.php n3ttools:content:categories:replace --regex "~https?://(www.)?example.com~" "https://www.another.com"

Replaces bold texts to underline texts:

php cli/joomla.php n3ttools:content:categories:replace --regex "~<strong>(.*?)</strong>~si" "<u>$1</u>"

Note

Replacement occurs in title, description, Meta description and META keywords in all categories.