Title: Index variable shortcode content
Last modified: May 3, 2023

---

# Index variable shortcode content

 *  Resolved [leviracz](https://wordpress.org/support/users/leviracz/)
 * (@leviracz)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/index-variable-shortcode-content/)
 * Hey, I have a single page with a shortcode on it, it’s mydomain.com/docs. “mydomain/
   docs/any/thing/can/go/here” is redirected to mydomain.com/docs, and the shortcode
   content varies on the current URI. Is it possible to index all my “subpages” 
   when they’re technically attached to a single post?
   All these urls pop up properly
   in RankMath sitemap if that helps. I would need a solution that can index this
   dynamic content and keeps the original, full url.I have Relevanssi Premium.
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/index-variable-shortcode-content/#post-16708026)
 * Answered in the Premium support.
 * (In short: no. Relevanssi indexes posts in the database, not URLs on your site.)
 *  Thread Starter [leviracz](https://wordpress.org/support/users/leviracz/)
 * (@leviracz)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/index-variable-shortcode-content/#post-16715448)
 * Hi [@msaari](https://wordpress.org/support/users/msaari/), thanks for your quick
   answer. I rather ask my next question here, because it might help others too.
   Is this planned in the future or is it technically possible at all?
   I believe
   the ability to add 3rd party urls to the index with custom, searchable content
   via a hook would solve my problem.
 * This seems like a feature that could be used in other cases too.
 * What do you think?
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/index-variable-shortcode-content/#post-16715454)
 * You can do this by creating a custom post type so that there’s a post for each
   third-party URL. Fetch the URL content and store it in the custom post, then 
   have Relevanssi index that custom post type and replace the URLs in permalinks
   so that they point to the outside URLs.
 * That way, this is possible. Relevanssi won’t have built-in support for this because
   it’s way too much trouble, but if you really need it, that’s the way to do it.
 * Simply indexing outside URLs will never be possible; that’s a WordPress restriction,
   as Relevanssi uses the WordPress search result template, which can only display
   posts. That’s why everything must be represented by a post.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Index variable shortcode content’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=2025044)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/index-variable-shortcode-content/#post-16715454)
 * Status: resolved