Print

Facebook Instant Articles – How to fix the error: No rules defined for

If you are using the Facebook Instant Articles plugin by Automattic and you are trying to publish a post you are sometimes getting the error below:

This post was transformed into an Instant Article with some warnings
! No rules defined for < div class="quads-location quads-ad3" > in the context of InstantArticle
! No rules defined for < div class="quads-location quads-ad2" > in the context of InstantArticle
! No rules defined for < div class="quads-location quads-ad5" > in the context of InstantArticle

In that particular issue you need to define a transformer rule like the following below:

{
    "rules":
    [
    {
        "class": "IgnoreRule",
        "selector" : ".quads-location.quads-ad3"
    },
{
        "class": "IgnoreRule",
        "selector" : ".quads-location.quads-ad2"
    },
{
        "class": "IgnoreRule",
        "selector" : ".quads-location.quads-ad5"
    }

  ]
}

You need a IgnoreRule block for any ad id you are using. So if you are using ad1 and ad2 the block need to look like that:

{
    "rules":
    [
    {
        "class": "IgnoreRule",
        "selector" : ".quads-location.quads-ad1"
    },
{
        "class": "IgnoreRule",
        "selector" : ".quads-location.quads-ad2"
    }

  ]
}