Finding shortcodes on a website is key when you want to identify existing functionalities, or add new ones, especially if you’re working with a platform like WordPress or any CMS that uses shortcode functions. Here’s a step-by-step procedure on how to identify and document shortcodes:
1. Identify the Platform and Theme
- First, determine if the website is built on a platform that supports shortcodes natively (like WordPress) or if it’s custom-coded.
- Understand the theme or framework being used, as some themes come with built-in shortcodes.
2. Check the CMS Documentation
- If you’re using a CMS like WordPress, review the documentation for any built-in shortcodes.
- Some plugins or themes provide their own documentation with lists of available shortcodes, so look there to see what’s included and how they are used.
3. Review the Page Editor or Post Content
- Open the content editor (like WordPress’s Classic or Block Editor) and inspect the text or HTML view.
- Shortcodes are usually enclosed within square brackets, for example,
or
[shortcode_name attribute="value"]
. - Look for any square-bracketed codes throughout pages and posts, as these are generally where shortcodes are placed.
4. Inspect the Website Code
- Open a web page and use the browser’s View Source feature (right-click and select “View Page Source”).
- Search for square brackets (
[
and]
) to locate any shortcodes embedded directly in the HTML. - Note that if shortcodes are dynamic (like
[recent-posts]
), the HTML output may already be rendered, but inspecting source files might still reveal shortcodes.
5. Use the CMS’s Shortcode Reference
- For WordPress, go to the Shortcodes API in the WordPress Codex for an overview of core shortcodes.
- Check for additional shortcodes added by plugins (e.g., WooCommerce, Contact Form 7) by visiting the plugin’s settings or documentation.
6. Check for Shortcodes in the Theme Files
- Access the theme files (either through the CMS editor or FTP access) and look in the functions.php file or any specific shortcode files.
- Look for function names like
add_shortcode
or similar, as these functions are used to create new shortcodes.
7. Use Shortcode Finder Plugins (if applicable)
- Some platforms, like WordPress, offer plugins (e.g., Shortcode Finder) that scan content for active shortcodes. This can speed up the process of identifying what shortcodes are in use across pages.
- Install the plugin, run the scan, and review the results to document which shortcodes are present.
8. Compile and Document Shortcode Information
- Once you’ve identified the shortcodes, create a list that includes:
- The shortcode name (e.g.,
).
- Any attributes it accepts (e.g.,
size="medium"
). - Its functionality or purpose (e.g., displays a gallery of images).
- The shortcode name (e.g.,
- For future SEO implementations, document where each shortcode is used, especially if it contributes to dynamic content (like pulling in product data or testimonials).
By following these steps, you’ll have a comprehensive view of the shortcodes in use on the website and can confidently hand over this information for implementation, optimization, or troubleshooting.