Finding Drupal content that uses the PHP filter

One new change in Drupal 6.0 is the PHP input format is now a part of an optional module instead of being enabled by default. After upgrading from Drupal 5, you can only disable the new PHP input format module if none of your content uses it. If you would like to determine which nodes, comments, blocks and content might be using the PHP filter so that you can migrate them and turn off the PHP module, keep on reading.

Drupal 5

How to find out which nodes, comments, and blocks use the PHP input format (assumes your database table prefix is drupal_)

select nid, vid from drupal_node_revisions where format in (select format from drupal_filters where module='filter' and delta = 1);

select cid, nid from drupal_comments where format in (select format from drupal_filters where module='filter' and delta = 1);

select bid, info from drupal_boxes where format in (select format from drupal_filters where module='filter' and delta = 1);

You will also need to check for any 2+ argument calls to check_markup() in non-core modules and themes.

Drupal 6

How to find out which nodes, comments, and blocks/boxes use the PHP filter in Drupal 6. The queries are different after upgrading to Drupal 6 because the PHP filter has already been migrated from the filter module to the php module (assumes your database table prefix is drupal_):

select nid, vid from drupal_node_revisions where format in (select format from drupal_filters where module = 'php' and delta = 0);

select cid, nid from drupal_comments where format in (select format from drupal_filters where module = 'php' and delta = 0);

select bid, info from drupal_boxes where format in (select format from drupal_filters where module = 'php' and delta = 0);

Again, you will still need to check for any 2+ argument calls to check_markup() in non-core modules and themes.

Taxonomy upgrade extras: 
Subscribe to All Posts - Wesley Tanaka