Pagefiles::findTag() method

Return all Pagefile objects that have the given tag(s).

Given tag may be any of the following:

  • foo (single tag): Will return all Pagefile objects having the specified tag.
  • foo|bar|baz (multiple OR tags): Will return Pagefile objects having at least one of the tags listed.
  • foo,bar,baz (multiple AND tags): Will return Pagefile objects having ALL of the tags listed (since 3.0.17).
  • ['foo','bar','baz'] (multiple AND tags array): Same as above but can be specified as an array (since 3.0.17).


$pagefiles = $pagefiles->findTag($tag);


tagstring, array

Return value


New Pagefiles array with items that matched the given tag(s).


  • 3.0.17 Added support for multiple AND tags and allow tag specified as an array.

See Also

Pagefiles methods and properties

API reference based on ProcessWire core version 3.0.161

Twitter updates

  • New ProcessWire query expansion search operators can now add automatic word inflections and lemmatisation, enabling you to build even smarter search engines with ProcessWire. More
    3 July 2020
  • ProcessWire 3.0.161 adds support for selector operator stacking, enabling you automatically broaden searches in a single pages.find() call— More
    26 June 2020
  • ProcessWire 3.0.160 adds powerful new text-searching operators, bringing a new level of power to page-finding API calls, especially when it comes to search engine type queries. Post also includes a demo search engine where you can test it all out live— More
    19 June 2020

Latest news

  • ProcessWire Weekly #321
    In the 321st issue of ProcessWire Weekly we're going to check out the latest core updates, introduce two new third party modules, and check out a brand new site of the week. Read on! / 4 July 2020
  • Powerful new text-searching abilities in 3.0.160
    In ProcessWire 3.0.160 we’ve got some major upgrades and additions to our text-search abilities. This brings a whole new level of power to $pages->find() and similar API calls, especially when it comes to search engine type queries.
    Blog / 19 June 2020
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH