Storing multimedia content in WordPress to COS
Last updated: 2020-04-19 19:10:15
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.
- Build WordPress.
- You can download the latest version of WordPress and view installation instructions at WordPress's official website.
- Create a Public Read/Private Write bucket as instructed in Creating Buckets, preferably in the same region as the CVM instance where WordPress runs.
- 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.
- Log in to the CAM Console and note down the
Installing and Configuring the WordPress Plugin
- Log in to the WordPress Dashboard.
- On the left sidebar, select Plugins > Add New to enter the plugin installation page. Search for and install the Media Cloud plugin here.
- 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.
- On the "Choose Your Storage Provider" page, select S3 Compatible and click NEXT.
- Configure the displayed form as follows and click NEXT:
||`SecretId` in the access key
||`SecretKey` in the access key
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
- 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.
- Media Cloud will display that "You are ready to use Media Cloud!". Click ADVANCED SETTINGS to close the Setup Wizard.
Testing Multimedia Content
- Write an article, add multimedia content to it, and publish it.
- 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).
- 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
- If you want to configure CDN acceleration for the bucket saved in the WordPress attachment, follow the steps in CDN Acceleration Configuration.
- Enter the management page of Media Cloud and click Settings below Cloud Storage.
- 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
- Check the multimedia content in the previously published article. As can be seen, the address points to the CDN domain name you configured.