Advanced Targeting

Single page is not enough and global option is too broad?
Let's take a look at advanced targeting!

The default options for advanced targeting include site specific post types and special pages, such as the search results page and the 404 error page.

We are actively improving our system to seamlessly integrate with Full Site Editing (FSE) and Bricks templates.

Both the search results page and the 404 error page need to have their own separate, dedicated pages. This allows you to open them in the Motion.page builder and link animations to their unique ID.

In addition, you'll need to specify this in the advanced targeting options, as WordPress doesn't use the post ID when displaying these particular pages. This step ensures that your animations appear correctly on these special pages.

In simpler terms, you're creating unique pages for search results and 404 errors, then adding animations to them using Motion.page. Lastly, you're telling WordPress to use these specially designed pages by selecting them in the advance targeting dropdown.


For those utilizing Oxygen builder, there are extra options available to target Oxygen templates.

Regular Expression / RegEx

In this section, you'll find easy-to-understand examples of using RegEx patterns to target archives, pages, or templates. This can be done without having to wait for specific theme or builder integration. These examples are designed to be user-friendly, so you don't need a technical background to understand them.

/\/january\/?$/

The regex /\/january\/?$/ can be broken down as follows:

  • / at the start and end are delimiters. They mark the beginning and end of the regex pattern.
  • \/ is looking for a literal slash /. The backslash is an escape character, which means the next character (the forward slash) is taken literally, not as a special symbol.
  • january is looking for the exact string january.
  • \/? is looking for zero or one literal slash /. The question mark means zero or one of the preceding element. So this part is saying there might be a slash after january, but it's okay if there isn't.
  • $ is a special character that matches the end of a string. It means whatever pattern is before it must be at the end of the string to be a match.

So, in plain English, this regex matches any path that ends with /january or /january/.

Depending on how you use it, this pattern can be applied to either an archive or just one individual page on your site.


/\/january\/?/

The regular expression /\/january\/?/ can be broken down as follows:

  • / at the start and end are delimiters. They mark the beginning and end of the regex pattern.
  • \/ is looking for a literal slash /. The backslash is an escape character, which means the next character (the forward slash) is taken literally, not as a special symbol.
  • january is looking for the exact string january.
  • \/? is looking for zero or one literal slash /. The question mark means zero or one of the preceding elements. So this part is saying there might be a slash after january, but it's okay if there isn't.

However, unlike the previous regex, this one does not have the $ at the end. This means it doesn't require january or january/ to be at the end of the string. It will match any string that contains /january or /january/ anywhere in the path.

Targets both archives and single pages.


/\/january\/.+/

The regular expression /\/january\/.+/ can be broken down as follows:

  • / at the start and end are delimiters. They mark the beginning and end of the regex pattern.
  • \/ is looking for a literal slash /. The backslash is an escape character, which means the next character (the forward slash) is taken literally, not as a special symbol.
  • january is looking for the exact string january.
  • \/ is looking for a literal slash /. Again, the backslash is used to escape the forward slash, meaning it's looking for the actual character / and not interpreting it as a special symbol.
  • .+ is looking for one or more of any character. The dot (.) is a special character in regex that matches any character except a newline, and the plus (+) means one or more of the preceding elements.

So, in plain English, this regex matches any string that contains /january/ followed by one or more of any character. It could be used, for example, to match paths that matches /january/ and have additional characters or path segments after that.

This pattern can be used for individual single pages in the archive, but not for the archive page / template itself.


/^\/about-us\/?$/

The regular expression /^\/about-us\/?$/ can be broken down as follows:

  • / at the start and end are delimiters. They mark the beginning and end of the regex pattern.
  • ^ is a special character that matches the start of a string. It means whatever pattern is after it must be at the start of the string to be a match.
  • \/ is looking for a literal slash /. The backslash is an escape character, which means the next character (the forward slash) is taken literally, not as a special symbol.
  • about-us is looking for the exact string about-us.
  • \/? is looking for zero or one literal slash /. The question mark means zero or one of the preceding elements. So this part is saying there might be a slash after about-us, but it's okay if there isn't.
  • $ is a special character that matches the end of a string. It means whatever pattern is before it must be at the end of the string to be a match.

So, in plain English, this regex matches any path that starts and ends with /about-us or /about-us/. It's typically used to match URLs or paths in a web application to determine if the user is on the about-us page.

100 %