sanitize_title ( $title, $fallback_title = '', $context = 'save' )

  • (string) title The string to be sanitized.
  • (string) fallback_title Optional. A title to use if $title is empty. Default empty.
  • (string) context Optional. The operation for which the string is sanitized. Default 'save'.
  • (string) The sanitized string.
Defined at:


Sanitizes a string into a slug, which can be used in URLs or HTML attributes.By default, converts accent characters to ASCII characters and further limits the output to alphanumeric characters, underscore (_) and dash (-) through the Array filter. If `$title` is empty and `$fallback_title` is set, the latter will be used.

Related Functions

sanitize_term, sanitize_url, sanitize_key, sanitize_option, sanitize_file_name

Top Google Results

User discussions

wpseek mobile