Storing multimedia content in WordPress to COS

Last updated: 2020-04-19 19:10:15

    Overview

    You can store multimedia content in WordPress to Tencent Cloud COS through a third-party plugin for the following benefits:

    • Multimedia content can be more reliable.
    • You don't have to prepare additional storage capacity on your server for multimedia content.
    • Visitors' requests to view and download multimedia content can be redirected to COS servers for faster access without consuming your downstream bandwidth/traffic.
    • Tencent Cloud CDN can be leveraged to further accelerate visitor's requests to view and download multimedia content.

    Preparations

    1. Build WordPress.
      • You can download the latest version of WordPress and view installation instructions at WordPress's official website.
    2. Create a Public Read/Private Write bucket as instructed in Creating Buckets, preferably in the same region as the CVM instance where WordPress runs.
    3. Find the just created bucket in the bucket list and note down its name and region abbreviation. For more information on region abbreviations, please see Regions and Access Domain Names.
    4. Log in to the CAM Console and note down the SecretId and SecretKey.

    Installing and Configuring the WordPress Plugin

    1. Log in to the WordPress Dashboard.
    2. On the left sidebar, select Plugins > Add New to enter the plugin installation page. Search for and install the Media Cloud plugin here.
    3. Start the Media Cloud plugin. The Setup Wizard will be automatically launched. Click NEXT.

      If the Setup Wizard is not automatically launched, select Media Cloud on the left sidebar in the WordPress Dashboard and click Setup Wizard below Cloud Storage.

    4. On the "Choose Your Storage Provider" page, select S3 Compatible and click NEXT.
    5. Configure the displayed form as follows and click NEXT:
      Configuration Item Description
      ACCESS KEY `SecretId` in the access key
      SECRET `SecretKey` in the access key
      BUCKET Bucket name
      REGION Select "Automatic"
      CUSTOM ENDPOINT Format: cos.<Region>.myqcloud.com, where `<Region>` is the region abbreviation of the bucket; for example, if the Guangzhou region (abbreviation: ap-guangzhou) is used, enter cos.ap-guangzhou.myqcloud.com here
    6. At this point, Media Cloud will test whether the configuration is correct. Click START TESTS to start the test and click NEXT after all test items pass.
    7. Media Cloud will display that "You are ready to use Media Cloud!". Click ADVANCED SETTINGS to close the Setup Wizard.

    Testing Multimedia Content

    1. Write an article, add multimedia content to it, and publish it.
    2. Copy the image address in the article or use a browser debugger to view the image path. As can be seen, the image address is an address on COS (as shown in box 1 in the screenshot in step 3).
    3. View the download address of the article attachment. As can be seen, the download address also points to COS (as shown in box 2 below).

    Using Tencent Cloud CDN

    1. If you want to configure CDN acceleration for the bucket saved in the WordPress attachment, follow the steps in CDN Acceleration Configuration.
    2. Enter the management page of Media Cloud and click Settings below Cloud Storage.
    3. Set the CDN Base URL in CDN SETTINGS to your CDN domain name, such as the default acceleration domain name for COS https://wordpress-1250000000.file.myqcloud.com/ or your custom acceleration domain name https://static.foo.bar/.
    4. Check the multimedia content in the previously published article. As can be seen, the address points to the CDN domain name you configured.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help