1. Home
  2. Docs
  3. Doc of File Renaming on U...
  4. Shortcodes
  5. Shortcodes Guide

Shortcodes Guide

File Renaming on Upload: Shortcodes Guide

This plugin allows you to automatically rename files during upload, ensuring clean, SEO-friendly filenames, and providing options to customize filename structures based on various criteria. The shortcodes are categorized into Free and Pro versions for easier reference.


Free Version Shortcodes

  1. [frou_rename_file]
    • Description: This shortcode triggers the file renaming process based on the settings configured in the plugin. It can be used manually on posts, pages, or widgets to rename files according to predefined rules.
    • Parameters:
      • file_id (required): The ID of the file to rename.
      • rule (optional): The specific rule to apply during renaming (e.g., lowercase, post_title, etc.).
    • Example Usage: [frou_rename_file file_id=”123″ rule=”lowercase”]
    • Use Case: Manually trigger renaming for a specific file when adding or editing content, ensuring filenames follow the desired format.
  2. [frou_generate_permalink]
    • Description: Generates a new permalink for the renamed file. This is useful for maintaining SEO consistency and ensuring that links to renamed files are updated automatically.
    • Parameters:
      • file_id (required): The ID of the file to generate the permalink for.
    • Example Usage: [frou_generate_permalink file_id=”123″]
    • Use Case: Automatically update the permalink whenever a file is renamed, preventing broken links and improving SEO.
  3. [frou_remove_accents]
    • Description: Removes accents and special characters from filenames upon upload. This shortcode is beneficial for creating standardized, URL-friendly filenames.
    • Parameters:
      • file_id (required): The ID of the file to process.
    • Example Usage: [frou_remove_accents file_id=”123″]
    • Use Case: Ensure filenames do not contain any special characters or accents that could affect URL readability or SEO.

Pro Version Shortcodes

  1. [frou_custom_rule]
    • Description: Applies a custom renaming rule to a file during upload. This allows for advanced customization, such as adding the date, post title, or other custom strings to the filename.
    • Parameters:
      • file_id (required): The ID of the file to rename.
      • rule (required): The custom rule to apply (e.g., custom_string, upload_date).
    • Example Usage: [frou_custom_rule file_id=”123″ rule=”upload_date”]
    • Use Case: Automatically append custom information, like the upload date, to filenames for better organization and SEO.
  2. [frou_update_all_files]
    • Description: Triggers a bulk update for all media files in the library, renaming them according to the configured rules. This is particularly useful for sites that want to standardize filenames retroactively.
    • Parameters:
      • confirm (required): A safety check to confirm the action (e.g., yes).
    • Example Usage: [frou_update_all_files confirm=”yes”]
    • Use Case: Quickly standardize all existing filenames in your media library to improve SEO and organization.
  3. [frou_manual_edit]
    • Description: Provides a form for manually editing the filename and permalink of a media file. This shortcode is useful for cases where you need precise control over individual file names.
    • Parameters:
      • file_id (required): The ID of the file to edit.
    • Example Usage: [frou_manual_edit file_id=”123″]
    • Use Case: Allow administrators to manually edit filenames and permalinks directly from a post or page, ensuring that filenames are customized to specific needs.
  4. [frou_sync_post_update]
    • Description: Automatically synchronizes the filename with the post title whenever the post is updated. This helps maintain consistency between content titles and their associated media files.
    • Parameters:
      • post_id (required): The ID of the post to synchronize with.
    • Example Usage: [frou_sync_post_update post_id=”456″]
    • Use Case: Ensure that media filenames reflect changes in post titles, enhancing organization and SEO.
  5. [frou_image_seo]
    • Description: Automates the generation of ALT text and media titles based on the filename or other metadata. This feature is crucial for improving image SEO and accessibility.
    • Parameters:
      • file_id (required): The ID of the file to optimize.
    • Example Usage: [frou_image_seo file_id=”123″]
    • Use Case: Automatically fill in ALT text and titles for images to ensure they are SEO-friendly and accessible.

These shortcodes offer a powerful way to automate and customize the renaming of files upon upload in WordPress, ensuring that your media library is clean, organized, and optimized for search engines. The Pro version provides additional features, such as manual editing, bulk updates, and enhanced SEO options, making it an indispensable tool for WordPress administrators focused on performance and organization.