Last update at :2024-06-01,Edit by888u
Currently, more and more users like to store attachments such as pictures separately in third-party object cloud storage. This process can save a lot of disk space for the server, reduce the workload of file migration when the website is moved, and is independent of the cloud. Storage also avoids server bandwidth limitations when accessing files, so it can reduce website construction/operation and maintenance costs and improve access experience. For object cloud storage, we are most familiar with Alibaba Cloud's OSS. Here is a brief introduction to its configuration and use on WordPress.
Create Bucket
Enter the Alibaba Cloud console. You can enter the OSS console through the menu's Products and Services>Storage and CDN>Object Storage OSS
, and then click the Create Bucket
button to create storage. Space, as shown in the figure:
There are two main points to note:
1.
Region
It is recommended to consider the location of your server. If you are using an Alibaba Cloud server, it is recommended to choose the same region as the server. This can save upload traffic through intranet intercommunication. cost, and the upload speed is much faster.2.
Read and write permission
SelectPublic read
, so that the image can be accessed normally.
WordPress backend OSS configuration
Plugin
OSS is not a function supported by WordPress by default, so it needs to be implemented through a plug-in. If you are using a theme developed by our WPCOM, then we strongly recommend using the OSS Upload
plug-in. We have tested many OSS plug-ins. After compatibility testing and code analysis, OSS Upload
is the only WordPress OSS plug-in we know of that has complete functions and reasonable hook mounting. To download the plug-in, please go to the author’s page: https://www.xiaomac.com/2016121895.html
Configuration
After installing and enabling the OSS Upload
plug-in, go to Settings>OSS Upload
and follow the prompts to set the plug-in options.
The following are options to note:
Access Key and Secret Key
Access Key
and Secret Key
can be obtained by logging into the Alibaba Cloud backend: click on the avatar in the upper right corner of the Alibaba Cloud interface, select accesskeys
, and then create them AccessKey, as shown in the figure:
Visit link
To access the link, fill in the external Bucket domain name
address (need to add http://
or https://
), if bound If you have entered your own domain name, you can fill in your own domain name address. If the Upload path
sets the saving directory, the access link also needs to be followed by the same directory.
Upload endpoint
To upload the endpoint, as mentioned when creating a new Bucket above, if it is an Alibaba Cloud server and the same region is selected, you can fill in the address of the internal network node
, if not, fill in the external network address.
If you fill in the information here, you can click the Test it
button on the page. If the prompt is normal, it means the connection is successful.
Thumbnail
It is recommended to choose Use parameter image service, default and simple
or Use physical thumbnails, and check the
option when the theme has thumbnail errors.
Remote Image
Theme also has similar functions (Theme Settings > Optimization Acceleration > Save Remote Images). If the theme is enabled, there is no need to enable it again.
Local backup
It is recommended to check it, especially during the early configuration and file synchronization process, to avoid the problem of unrecoverable loss of pictures.
Other Featured images
, Style separator
, Full image style
, Automatic compression
, Extension Options such as simultaneous loading
and delayed link
can be ignored.
After the settings are completed, click the Save changes
button, and then click Upload the entire local storage directory
to synchronize the files to OSS. This process may take some time. After the synchronization is completed, You can test whether the images can be accessed normally by visiting the front page of the website. If so, it means the configuration is successful.
Recommended site search: Mainland China IP proxy, multi-IP station group server, Ministry of Industry and Information Technology website registration free US host China mainland registration-free host, proxy service IP, wordpress space, foreign domain names, Alibaba Cloud free virtual host, ICP registration query system ,
发表评论